Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show variant name of tagged enum? #98

Open
JakkuSakura opened this issue Dec 16, 2023 · 2 comments
Open

How to show variant name of tagged enum? #98

JakkuSakura opened this issue Dec 16, 2023 · 2 comments

Comments

@JakkuSakura
Copy link
Collaborator

My endpoint returns a tagged enum

enum Foo {
Price(FooPrice),
...
}

However, in redoc it's displayed as many object. I have to click through them to see the details. I checked the generated openai.json, each variant is inlined within the enum, rather than taking a reference to #/components/schemas/Foo_FooPrice

I wonder if there's a way to let variants display with their name, rather than object?
image

@JakkuSakura
Copy link
Collaborator Author

Seems related to GREsau/schemars#157

@tomas789
Copy link

@JakkuSakura I believe this issue is the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants