How can response status code make sense for multiple media types for error status codes
If we follow the OAS3 spec for Response herewe can see that each response status code can have multiple media types and each media type inturn has a schema particular to it. For example below, we can see 200 has a binary stream response but 400 has 2 media-types:application/json, application/xml. So is client expected to request accept-type header with all the media-types mentioned below. How can we have specific media-type for 400 response code, or basically how we can convey to the REST Service to respond with media type as application/xml when its a 400 bad request if 200 is returning a binary stream. Does this OAS3 response multiple media-type make sense for Client/Server Errors. If yes then whats the accept-type set for expecting, say "application/xml" for 400 bad request '200': description: Document content from the Archive content: application/octet-stream: schema: type: string format: binary '400': description: One or more input parameters are invalid content: application/json: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_400" application/xml: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_400" '403': description: Consumer doesn't have access to the document content: application/xml: schema: type: "object" properties: errors: $ref: "#/components/schemas/Error_403"Does response from OpenApi3.0 callback return to the endpoint configured with callback or client
If I am having a client hitting a request to an endpoint E1 which is configured to the callback endpoint CE1, then the response of the callback endpoint should be returned to the client or the E1 endpoint. I am a bit confused. Is it that the callback endpoint CE1 is invoked asynchronously by the service provider for E1 and the response from the callback endpoint CE1 is recorded by themselves and the client is nowhere in the picture as of now. Is it so that the invocation of CE1 be part of serving the request for E1(CE1 chained after E1) ?Does OpenApi Operation having callback invoke internally or needs to be implemented ?
Basically, my query is how do I invoke the callback URL for a specific operation(ex post,get etc...). I am able to reflect the details of the callback URL expression in swagger UI but it didn't get invoked. Is it needed to make changes to the swagger UI JS files wherein I'll first resolve the runtime expression for the callback URL and then invoke the same as well?SolvedHow to have a custom status code in response
responses: '777': description: My Custom content: application/json: schema: type: string If I have "777" like fieldName for the status code in OAS3.0 spec YAML, then the editor.swagger.io throws an error as "should only have three-digit status codes, `default`, and vendor extensions (`x-*`) as properties" If I have the same status code in Swagger2.0 spec YAML, as below, then it doesn't throw an error. responses: '777': description: custom schema: type: string PS: I checked the indentation, it seems correct because if I change "777" in OAS3.0 spec YAML to standard status code like "400", "200" then it doesn't throw an error.Solved6.1KViews0likes2Comments