Docs
API
Interfaces
JsonSchemaHTTPOperation

Interface: JsonSchemaHTTPOperation

types/src.YamlConfig.JsonSchemaHTTPOperation

Table of contents

Properties

Properties

argTypeMap

Optional argTypeMap: Object

Mapping the JSON Schema and define the arguments of the operation. Example: 'argTypeMap: ID: String'

Index signature

▪ [k: string]: any

Defined in

packages/types/src/config.ts:451


binary

Optional binary: boolean

If true, this operation cannot have requestSchema or requestSample And the request body will be passed as binary with its mime type unless you define an explicit Content-Type header

Defined in

packages/types/src/config.ts:467


description

Optional description: string

Your chance to describe the operation! Make sure the description is clear and concise.

Defined in

packages/types/src/config.ts:380


exposeResponseMetadata

Optional exposeResponseMetadata: boolean

Expose response details done to the upstream API When you enable this, you will see a new field in the response type;

type MyResponseType {
  myFooField: String
  _response: ResponseMetadata
}

# And a new type for the response metadata object
type ResponseMetadata {
  url: URL
  status: Int
  method: String
  headers: JSON
  body: String
}

Defined in

packages/types/src/config.ts:446


field

field: string

This Field based on the field name of the URL path. Example: "https://MyAPIURL.com/FieldNameHere/", so we will set the "field: FieldNameHere".

Defined in

packages/types/src/config.ts:375


headers

Optional headers: Object

Index signature

▪ [k: string]: any

Defined in

packages/types/src/config.ts:459


method

Optional method: "GET" | "POST" | "HEAD" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE" | "PATCH"

Allowed values: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH

Defined in

packages/types/src/config.ts:458


path

path: string

Defined in

packages/types/src/config.ts:454


requestBaseBody

Optional requestBaseBody: any

This body will be merged with the request body sent with the underlying HTTP request

Defined in

packages/types/src/config.ts:402


requestSample

Optional requestSample: any

The path definition of the JSON Schema sample. Example: "./jsons/questions.response.json".

Defined in

packages/types/src/config.ts:393


requestSchema

Optional requestSchema: any

Your chance to provide request schema name.

Defined in

packages/types/src/config.ts:388


requestTypeName

Optional requestTypeName: string

Inset any name for the type of the request body.

Defined in

packages/types/src/config.ts:397


responseByStatusCode

Optional responseByStatusCode: any

You can define your response schemas by status codes;

responseByStatusCode:
  200:
    responseSchema: ./someschema.json#/somepath
  404:
    responseSample: ./error-sample.json
    responseTypeName: MyError

Defined in

packages/types/src/config.ts:426


responseSample

Optional responseSample: any

Did you use Sample? Provide the response sample path.

Defined in

packages/types/src/config.ts:410


responseSchema

Optional responseSchema: any

Yay! Now you can provide the response schema name.

Defined in

packages/types/src/config.ts:406


responseTypeName

Optional responseTypeName: string

Inset any name for the type of the response body.

Defined in

packages/types/src/config.ts:414


type

type: "Query" | "Mutation" | "Subscription"

Type field is set the opertion type: Query, Mutation or Subscription. (Allowed values: Query, Mutation, Subscription)

Defined in

packages/types/src/config.ts:384