OAS 3.0.3 request schema for an empty JSON body
I am attempting to create an OAS schema for an empty JSON body: { } I am trying to get the documentation to show an empty JSON body, and have that autogenerated. The API defines this as a POST (yes, it ought to be a GET, the design of the API is in some respects sub-optimal) request, and expects the open/close bracket, and nothing else. I've tried … content: application/json: { } … but that doesn't work (it just shows nothing in the request body), and everything else I've tried is invalid. Would appreciate any assistance on this. I have not been able to find any examples or even similar questions (maybe I’m looking in the wrong place?). Any assistance would be greatly appreciated!Solved6.2KViews0likes2CommentsDoes 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?SolvedObject property name as UUID
In the given API response how would you write the schema yaml to support UUIDs as a property name { "results": { "11b17cd8-0000-0000-0000-2092b242027f": [ { "id": "0000", "type": "Home", "ownership": "", "monthly": "0", "address_1": "23299 Address Parts", "address_2": "", "city": "Some City", "state": "ZZ", "zip": "00000", "active": "1", "primary": "1" } ] } } Here is my attempt (schema portion): components: schemas: uuid: type: string format: uuid description: UUID example: 00000000-0000-0000-0000-000000000000 pattern: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' CustomerAddresses: type: object properties: '#/components/schemas/uuid': type: array items: $ref: '#/components/schemas/CustomerAddress' CustomerAddress: type: object properties: id: type: string example: "3014" type: type: string enum: ['Home', 'Work'] ownership: type: string example: "" monthly: type: string example: "0" address_1: type: string example: "23444 Address Parts" address_2: type: string example: "Unit 42" city: type: string example: "Some City" state: type: string maxLength: 2 minLength: 2 example: "ZZ" zip: type: string format: int32 example: "00000" active: type: string enum: ["0", "1"] primary: type: string enum: ["0", "1"]SolvedUsing OAS with Swagger-Inline to Document API
How do I describe an object using swagger-inline formats for use with the oas npm tool? In the below, the selector portion of the request body is a nested object that looks something like this: { property: {condition: String value}, property: {condition: Integer value} } /* * @oas [post] /db/{db}/query/document * description: "Returns information about a specific document." * parameters: * - (path) db=test* {String} The name of the database to query. * - (body) selector* {object} An object containing selectors used for querying * - (body) fields* {String} An array containing the fields returned by the query * - (body) limit {Integer:int32} How many documents to return */