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.3KViews0likes2CommentsGeneration of Schema from API specification for model definition
I understand the model definition is part of Open Api specification, but this definition just helps in reference and not usable at all both for consumers and provider. Just like we can generate the code stub from the specification it will be great if we can generate schema definition in json schema with the versions.1.6KViews0likes1CommentDoes it make sense to apply Required to a response schema field?
Up until now, I have set Required=true only for request schema fields. For response schema fields that I know won't be populated with null, I have set Nullable=false. Now, for the sake of Microsoft's AutoRest tool and the code it generates, I am being asked to set Required=true as well as Nullable=false for response fields. Does this make sense semantically? To my mind, it doesn't. I know you can set Request=true for response fields, but does it make sense to do so?668Views0likes0Comments