@@ -303,19 +303,24 @@ type Service struct {
303
303
304
304
// Endpoint holds the config of a endpoint
305
305
type Endpoint struct {
306
- Kind EndpointKind `json:"kind" yaml:"kind" mapstructure:"kind"`
307
- Tmpl TemplatingEngine `json:"template,omitempty" yaml:"template,omitempty" mapstructure:"template"`
308
- ReqTmpl string `json:"requestTemplate" yaml:"requestTemplate" mapstructure:"requestTemplate"`
309
- GraphTmpl string `json:"graphTemplate" yaml:"graphTemplate" mapstructure:"graphTemplate"`
310
- ResTmpl string `json:"responseTemplate" yaml:"responseTemplate" mapstructure:"responseTemplate"`
311
- OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" mapstructure:"outputFormat"`
312
- Token string `json:"token,omitempty" yaml:"token,omitempty" mapstructure:"token"`
313
- Claims string `json:"claims,omitempty" yaml:"claims,omitempty" mapstructure:"claims"`
314
- Method string `json:"method" yaml:"method" mapstructure:"method"`
315
- Path string `json:"path" yaml:"path" mapstructure:"path"`
316
- Rule * Rule `json:"rule,omitempty" yaml:"rule,omitempty" mapstructure:"rule"`
317
- Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers"`
318
- Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout"` // Timeout is in seconds
306
+ Kind EndpointKind `json:"kind" yaml:"kind" mapstructure:"kind"`
307
+ Tmpl TemplatingEngine `json:"template,omitempty" yaml:"template,omitempty" mapstructure:"template"`
308
+ // ReqPayloadFormat specifies the payload format
309
+ // depending upon the payload format, the graphQL request that
310
+ // gets converted to http request will use that format as it's payload
311
+ // currently supported formats are application/json,multipart/form-data
312
+ ReqPayloadFormat string `json:"requestPayloadFormat" yaml:"requestPayloadFormat" mapstructure:"requestPayloadFormat"`
313
+ ReqTmpl string `json:"requestTemplate" yaml:"requestTemplate" mapstructure:"requestTemplate"`
314
+ GraphTmpl string `json:"graphTemplate" yaml:"graphTemplate" mapstructure:"graphTemplate"`
315
+ ResTmpl string `json:"responseTemplate" yaml:"responseTemplate" mapstructure:"responseTemplate"`
316
+ OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" mapstructure:"outputFormat"`
317
+ Token string `json:"token,omitempty" yaml:"token,omitempty" mapstructure:"token"`
318
+ Claims string `json:"claims,omitempty" yaml:"claims,omitempty" mapstructure:"claims"`
319
+ Method string `json:"method" yaml:"method" mapstructure:"method"`
320
+ Path string `json:"path" yaml:"path" mapstructure:"path"`
321
+ Rule * Rule `json:"rule,omitempty" yaml:"rule,omitempty" mapstructure:"rule"`
322
+ Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers"`
323
+ Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout"` // Timeout is in seconds
319
324
}
320
325
321
326
// EndpointKind describes the type of endpoint. Default value - internal
@@ -330,6 +335,12 @@ const (
330
335
331
336
// EndpointKindPrepared describes an endpoint on on Space Cloud GraphQL layer
332
337
EndpointKindPrepared EndpointKind = "prepared"
338
+
339
+ // EndpointRequestPayloadFormatJSON specifies json payload format for the request
340
+ EndpointRequestPayloadFormatJSON string = "json"
341
+
342
+ // EndpointRequestPayloadFormatFormData specifies multipart/form-data payload format for the request
343
+ EndpointRequestPayloadFormatFormData string = "form-data"
333
344
)
334
345
335
346
// TemplatingEngine describes the type of endpoint. Default value - go
0 commit comments