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
I tested it further, example with just one value works as expected, but from my understanding examples with an array of values is the correct way since JSON schema draft 6
@jan-ldwg thanks for the heads up. When I reviewed I checked this detail, but I must have done something wrong. I'll take a look. Contributions are welcome, in case you beat me on time. - finally I used the Copilot CLI. 👀
This is what Claude Sonnet 4.6 analyzed with the Copilot CLI:
The root cause was that enum without an explicit type field (perfectly valid JSON Schema) fell through to return None — the enum check in ScalarExampleHandler was only
reached when there was a type to dispatch on. Fixed by adding an early enum check in get_example_from_schema itself, just like the examples check, so it catches all
cases regardless of whether type is present.
@jan-ldwg can you please try definining a type for the enum in your case? When I reviewed, I reviewed the situation of enums having type defined in the schema.
Activity
jan-ldwg commentedon Mar 5, 2026
I tested it further,
examplewith just one value works as expected, but from my understandingexampleswith an array of values is the correct way since JSON schema draft 6Fix #64: use examples array and enum values in auto-generated schema …
jan-ldwg commentedon Mar 7, 2026
Thank you for the quick fix!
examplesworks as expected, however,enumstill rendersnullfor me, not the first element.RobertoPrevato commentedon Mar 7, 2026
@jan-ldwg thanks for the heads up. When I reviewed I checked this detail, but I must have done something wrong.
I'll take a look. Contributions are welcome, in case you beat me on time.- finally I used the Copilot CLI. 👀RobertoPrevato commentedon Mar 7, 2026
This is what Claude Sonnet 4.6 analyzed with the Copilot CLI:
Fix enum without explicit type rendering as null (issue #64)
RobertoPrevato commentedon Mar 7, 2026
@jan-ldwg can you please try definining a
typefor the enum in your case? When I reviewed, I reviewed the situation of enums having type defined in the schema.jan-ldwg commentedon Mar 7, 2026
You`re right, having a type defined fixes it. Thank you!
RobertoPrevato commentedon Mar 7, 2026
Thanks! in any case, I will apply the fix for the situation without type defined. I won´t release it today to PyPi, though.
Fix #64 enums without declared type (#77)