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

Dynamically change request body according to selected "anyOf" option

Open hadar-co opened this issue 3 months ago • 1 comments

Is your feature request related to a problem?

When a spec has anyOf or oneOf keys, the request body under the REQUEST panel shows an example of the first option only. When selecting a different option, the body doesn't change, which can be confusing and requires the user to change it manually.

Describe the solution you'd like

When using anyOf or oneOf, the request body under the REQUEST should change dynamically when selecting one of the options, to show the relevant object/s.

Describe alternatives you've considered

Manually adjusting the body.

hadar-co avatar Oct 19 '25 14:10 hadar-co

You can include examples in your spec to display the different schema options that are exposed via anyOf or oneOf. When you click on one of these examples, the request example will update.

Image

It however would be nice for this to happen dynamically as you described.

Devon-White avatar Nov 03 '25 02:11 Devon-White