Skip to content

Fix #64 enums without declared type#77

Merged
RobertoPrevato merged 3 commits intomainfrom
fix/64b
Mar 7, 2026
Merged

Fix #64 enums without declared type#77
RobertoPrevato merged 3 commits intomainfrom
fix/64b

Conversation

@RobertoPrevato
Copy link
Member

No description provided.

RobertoPrevato and others added 3 commits March 7, 2026 10:52
When a schema uses 'enum' without a 'type' field (valid JSON Schema),
get_example_from_schema fell through to 'return None' because there was
no type to dispatch to a ScalarExampleHandler. The enum check in
ScalarExampleHandler.get_example was never reached.

Fix: add an early enum check in get_example_from_schema itself, after
the 'examples' check and before the type dispatch, so typeless enums
also return their first value.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RobertoPrevato RobertoPrevato merged commit 319d55e into main Mar 7, 2026
6 checks passed
@RobertoPrevato RobertoPrevato deleted the fix/64b branch March 7, 2026 10:30
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

Successfully merging this pull request may close these issues.

1 participant