You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love how clean this thing looks when generating a requestBody with a complicated schema, but we ran into one particular case that didn't seem supported.
There doesn't seem to be support for nesting multiple layers of oneOf.
If you render the example below you'll see that only the oneOf at the top-level (in /example's schema object), is toggled through the "Option 1", "Option 2" drop-down for the Request Body section. The Example Request, also has a oneOf on requestBody, which isn't being presented to the user.
I'm assuming this probably isn't a quick fix, but it would be a great feature to add... Would it be possible to nest the Option 1, Option 2 concept for additional anyOf layers?
I've put together an example that tries to illustrate the issue:
Hey! Sorry for the delay. Can confirm that doesn't produce an ideal result. If I'm following correctly there should be 3 possible options?
ExampleRequest with Request A
ExampleRequest with Request B
InfoRequest
I thought that the nested scenario was handled, but I must of messed something up in the oneOfResolver. Let me try to take a look over the next week and see if I can figure it out!
@quangkhoa actually proposed your idea early in the roadmap as an alternate UI! I couldn't find out how to pull it off back then, but maybe it's something worth revisiting now as it's a nicer experience.
Love how clean this thing looks when generating a requestBody with a complicated schema, but we ran into one particular case that didn't seem supported.
There doesn't seem to be support for nesting multiple layers of oneOf.
If you render the example below you'll see that only the oneOf at the top-level (in /example's schema object), is toggled through the "Option 1", "Option 2" drop-down for the Request Body section. The Example Request, also has a oneOf on requestBody, which isn't being presented to the user.
I'm assuming this probably isn't a quick fix, but it would be a great feature to add... Would it be possible to nest the Option 1, Option 2 concept for additional anyOf layers?
I've put together an example that tries to illustrate the issue:
The text was updated successfully, but these errors were encountered: