aide icon indicating copy to clipboard operation
aide copied to clipboard

How to show variant name of tagged enum?

Open JakkuSakura opened this issue 1 year ago • 2 comments

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 avatar Dec 16 '23 04:12 JakkuSakura

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

JakkuSakura avatar Dec 16 '23 04:12 JakkuSakura

@JakkuSakura I believe this issue is the answer.

tomas789 avatar Feb 15 '24 07:02 tomas789