Open korygin opened 4 years ago
Hi @korygin Would you be able to provide an example of either the document you are trying to generate or what you are trying to parse. An OpenAPI V2 document can only have a single body parameter. There can be multiple "produces" or "consumes" values, but there can only be one schema. in a V3 document each media type object can have its own schema.
Hi Darrel,
If one of request body's media types is "application/x-www-form-urlencoded" and is assigned the schema object that has a definition reference (not properties), Open API writer fails to write the body parameter when SerializeAsV2() method is called.
SerializeAsV3() correctly outputs the body parameter with "application/x-www-form-urlencoded" content type and corresponding schema reference.
Hope this helps.
Alex
@korygin It would really help if you could provide at least a partial OpenAPI description of what you are trying to parse and render. Thanks.
Hi Darrel,
There is nothing to parse, I’m assembling a brand new OpenAPI document object using your library from some other metadata. So this would have to be reproduced with code / unit test.
Create a simple OpenAPI document object with:
Now try to output / write the created document as v2 (Swagger) json or yaml. You will see that the output document is missing the request body all together.
Hope this helps.
Regards,
Alex
On Apr 26, 2020, at 12:59, Darrel notifications@github.com wrote:
@koryginhttps://github.com/korygin It would really help if you could provide at least a partial OpenAPI description of what you are trying to parse and render. Thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/OpenAPI.NET/issues/467#issuecomment-619585357, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLM2QSCS5OKKPC6GWDM6W3RORR73ANCNFSM4LGSAX3A.
Hi,
We experience the issue with generating OpenAPI v2 (Swagger) documents which have multiple entries (media types) in the request body's content dictionary. In such cases, produced documents do not have body parameters. If content dictionaries have a single entry then body parameters appear in the generated documents as expected. Is this behavior by design?
Thanks,
Alex