tamasfe / aide

An API documentation library
Apache License 2.0
419 stars 70 forks source link

How to show variant name of tagged enum? #98

Open JakkuSakura opened 11 months ago

JakkuSakura commented 11 months ago

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 commented 11 months ago

Seems related to https://github.com/GREsau/schemars/issues/157

tomas789 commented 9 months ago

@JakkuSakura I believe this issue is the answer.