UNPKG

@asyncapi/specs

Version:
127 lines (122 loc) 2.92 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/bindings/http/0.1.0/operation.json", "title": "HTTP operation bindings object", "description": "This object contains information about the operation representation in HTTP.", "type": "object", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "type": { "type": "string", "enum": [ "request", "response" ], "description": "Required. Type of operation. Its value MUST be either 'request' or 'response'." }, "method": { "type": "string", "enum": [ "GET", "PUT", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE" ], "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." }, "query": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } ], "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." }, "bindingVersion": { "type": "string", "enum": [ "0.1.0" ], "description": "The version of this binding. If omitted, 'latest' MUST be assumed." } }, "required": [ "type" ], "oneOf": [ { "properties": { "type": { "const": "request" } }, "required": [ "method" ] }, { "properties": { "is": { "const": "response" } }, "not": { "required": [ "method" ] } } ], "examples": [ { "type": "response", "query": { "type": "object", "required": [ "companyId" ], "properties": { "companyId": { "type": "number", "minimum": 1, "description": "The Id of the company." } }, "additionalProperties": false }, "bindingVersion": "0.1.0" }, { "type": "request", "method": "GET", "query": { "type": "object", "required": [ "companyId" ], "properties": { "companyId": { "type": "number", "minimum": 1, "description": "The Id of the company." } }, "additionalProperties": false }, "bindingVersion": "0.1.0" } ] }