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

[FR] Use query param examples in demo/code example

Open IanVS opened this issue 2 years ago • 6 comments

Is your feature request related to a problem?

Not sure if this is a bug or a feature request. I would like to show examples of query parameters in the code sample snippets, but adding them as examples to my parameters does not cause them to be included either there or in the demo sidebar.

Describe the solution you'd like

Adding an example to a query param should make it be included in the demo box and the code snippets, similar to the way that examples are added to request bodies.

Describe alternatives you've considered

N/A

IanVS avatar Feb 13 '23 16:02 IanVS

Hi @IanVS, this is a known limitation. Currently, the behavior is that requestBodies are "pre-loaded" into code snippets but parameters require user input to appear. You're welcome to open a FR for this as I can see how it makes sense to pre-load parameter values. I suppose the initial params should be based on defaults/examples and fall back to data type.

sserrata avatar Feb 17 '23 15:02 sserrata

You're welcome to open a FR for this

Sorry, but isn't that what this is? Do you mean open a PR for it?

IanVS avatar Feb 17 '23 15:02 IanVS

Yup, disregard. There's so many issues that I confused this with another one. 😅

sserrata avatar Feb 17 '23 19:02 sserrata

Haha I know how that goes. Sorry I've been opening so many issues / discussions. I've been really liking the tool overall though. I even just tweeted about it! https://twitter.com/IanVanSchooten/status/1626668097984765953

IanVS avatar Feb 17 '23 19:02 IanVS

Are there any updates regarding this issue?

bertPB avatar Jan 22 '24 12:01 bertPB

related to #544

sserrata avatar Jun 28 '24 20:06 sserrata