diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index ada84777fd..bfa2fcf3ea 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -630,7 +630,7 @@ $defs: requestBody: true description: type: string - body: + server: $ref: '#/$defs/server' oneOf: - required: diff --git a/tests/schema/pass/path_item_servers_parameters.yaml b/tests/schema/pass/path_item_servers_parameters.yaml new file mode 100644 index 0000000000..5db8a25cbf --- /dev/null +++ b/tests/schema/pass/path_item_servers_parameters.yaml @@ -0,0 +1,112 @@ +openapi: 3.1.0 +info: + title: API + version: 1.0.0 +paths: + /things: + summary: Lots of things + servers: + - url: https://things.example.com + get: + summary: Get a list of things + externalDocs: + description: Find more info here + url: https://example.com + parameters: + - $ref: '#/components/parameters/biscuit' + summary: The maximum number of things to return + description: The maximum number of things to return + responses: + default: + description: A list of things + servers: + - url: https://things.example.com + post: + deprecated: false + requestBody: + $ref: '#/components/requestBodies/ThingRequestBody' + responses: + '201': + $ref: '#/components/responses/ThingResponse' + callbacks: + myCallback: + '{$request.query.queryUrl}': + post: + requestBody: + description: Callback payload + content: + application/json: + schema: + $ref: '#/components/schemas/SomePayload' + responses: + '200': + description: callback successfully processed + transactionCallback: + $ref: '#/components/callbacks/transactionCallback' + patch: {} + delete: {} + head: {} + options: {} + trace: {} +components: + callbacks: + transactionCallback: + 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}': + post: + requestBody: + description: Callback payload + content: + application/json: + schema: + $ref: '#/components/schemas/SomePayload' + responses: + '200': + description: callback successfully processed + examples: + ThingExample: + summary: A thing + description: A thing + value: + id: 1 + name: Thing + links: + ThingLink: + description: A link to a thing + operationId: getThing + parameters: + thingId: '$response.body#/id' + server: + url: https://things.example.com + ThingyLink: + $ref: '#/components/links/ThingLink' + parameters: + limit: + name: limit + in: query + required: false + allowEmptyValue: false + allowReserved: false + deprecated: true + description: The maximum number of list items to return + schema: + type: integer + minimum: 0 + biscuit: + name: biscuit + in: cookie + style: form + schema: + type: string + requestBodies: + ThingRequestBody: + content: + application/json: + schema: + type: object + responses: + ThingResponse: + description: A thing + content: + application/json: + schema: + type: object \ No newline at end of file