Skip to content

Conversation

@andreasjansson
Copy link
Member

No description provided.

The allOf can contain either:
1. A $ref pointing to a separate schema
2. An inline enum definition directly

The code was assuming $ref always exists, but real schemas often
have the enum inlined in allOf[0] directly.
Added tests for enums defined inline in allOf (without $ref):
- test_inline_enum_identical: no changes, should pass
- test_inline_enum_added_choice: adding choices is backwards compatible
- test_inline_enum_removed_choice: removing choices breaks compatibility
- test_inline_enum_changed_type: changing enum type breaks compatibility
Since get_openapi_schema() calls dereference_schema(), all $ref are
already resolved by the time check_backwards_compatible is called.
The allOf will always contain the inline enum definition directly.
Since schemas are dereferenced before check_backwards_compatible,
$ref is never present. Tests now use the realistic inline enum format.
@andreasjansson andreasjansson merged commit 2ea3b29 into main Dec 4, 2025
4 checks passed
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.

2 participants