microsoft/OpenAPI.NET.CSharpAnnotations

Response type attribute does not work

VasylSulakov opened this issue · 4 comments

Hi,
the following does not work, although described in the project wiki, so I have to make it manually with the underlying OpenApi document

<response code="200" type="application/json">Returns json</response>

@VasylSulakov it's not working b/c you need to specify the schema type of the response too e.g. below

<response code="200" type="application/json"><see cref="string"/>Returns json</response>

Can you document like above and see if it works for you.

Thanks a lot, it worked, but it would be great if this is mentioned in the wiki somehow, because, although it could be pretty straightforward from the OpenApi specs point of view, it is not obvious for a common user.

And how do I provide schema format alongside with schema type (i.e. cref)?

@VasylSulakov its already documented under response tag in https://github.com/Microsoft/OpenAPI.NET.CSharpAnnotations/wiki/C%23-Comment-Tag-Guide . Regarding providing the schema format, just document the correct C# type of the object in cref and we will generate the correct schema with right format for you. e.g. if a type is Guid then we generate Schema with type as string and format as uuid. Do you have a cref for which its not working as expected?

@VasylSulakov closing this, please reopen if above reply doesn't solve the issue.