docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

OpenAPI Specification Extension Support

Open r-colvin opened this issue 3 years ago • 2 comments

Is your feature request related to a problem?

  • No

As discussed on Discord: https://discord.com/channels/398180168688074762/867060369087922187/1022259147636473886

OpenAPI supports specification extensions (those that start with x-) - PA OpenAPI has some support currently, however it would be benefical to render those that the plugin doesn't know what to do with as documentation

Describe the solution you'd like

an example would be how Swagger.io handles these

image

Describe alternatives you've considered

Additional context

r-colvin avatar Sep 22 '22 12:09 r-colvin

Hi @r-colvin, thanks for the recommendation. I think, minimally, we should document the extensions supported by the plugin. Outside of that, I would like to better understand why we should support discovering and rendering extensions like the one in your example. Do you have any concrete/practical examples that you can share? I understand the relationship between x-dummy-data and what is rendered in Swagger UI but I would like to see a real-world example.

sserrata avatar Oct 04 '22 20:10 sserrata

Hello,

What's the status on this issue?

@sserrata I have good use cases for extension that are not covered by default OpenAPI keys. For instance, we need to give information about the rate limit applied by the server on specific endpoints, this information is only necessary for client developers to know what kind of caching they should apply.

image

Mikescops avatar Apr 18 '24 09:04 Mikescops

@r-colvin @sserrata when I wanted to do a PR I figured out while reading the code that there is actually an option to rend the x- fields in a simple way (that is good enough in my use case).

You can use showExtensions: true in your config.

image

Maybe there is room to improve a little bit the UI but that's fine for now.

Mikescops avatar May 31 '24 12:05 Mikescops

@Mikescops thanks mate! really appreciate the ping; I will need to check into this! but really, thanks for thinking of me! :)

r-colvin avatar Jun 03 '24 18:06 r-colvin