Commit 319d55e
* Fix enum without explicit type rendering as null (issue #64)
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>
* Update CHANGELOG.md
* Update __init__.py
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fda4c0e commit 319d55e
File tree
4 files changed
+13
-1
lines changed- openapidocs
- mk/v3
- tests
4 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
0 commit comments