Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multiple methods in http bindings #131

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 52 additions & 89 deletions http/json_schemas/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,26 @@
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension"
},
"^(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|TRACE)": {
"type": "object",
"properties": {
"query": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."
},
"requestBody": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"description": "A Schema object containing definitions for each request body parameters."
},
"response": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"description": "A Schema object containing the definitions for each response parameter."
}
}
}
},
"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": {
"$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema",
"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": [
Expand All @@ -46,74 +36,47 @@
"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."
"GET": {
"query": {
"type": "object",
"properties": {
"userId": {
"type": "string"
}
}
},
"additionalProperties": false
"response": {
"type": "object",
"properties": {
"userId": {
"type": "string"
},
"userName": {
"type": "string"
}
}
}
},
"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."
"POST": {
"requestBody": {
"type": "object",
"properties": {
"userName": {
"type": "string"
}
}
},
"additionalProperties": false
},
"bindingVersion": "0.1.0"
"response": {
"type": "object",
"properties": {
"userId": {
"type": "string"
}
}
}
}
}
]
}




}