Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion preprocess_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def normalize_metadata_schemas(schemas, target_dir):
ucp_path = str((target_dir / "ucp.json").resolve())
if ucp_path in schemas:
ucp = schemas[ucp_path]
ucp["oneOf"] = [
ucp["anyOf"] = [
{"$ref": f"#/$defs/{name}"} for name in metadata_union_members(ucp)
]

Expand Down
7 changes: 4 additions & 3 deletions tests/test_codegen_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ def test_generate_variants_writes_operation_specific_files(self) -> None:
class PipelineDependencyTest(unittest.TestCase):
"""Tests metadata normalization and transitive variant dependencies."""

def test_normalize_metadata_schemas_sets_root_union_and_ucp_refs(
def test_normalize_metadata_schemas_sets_root_anyof_and_ucp_refs(
self,
) -> None:
"""Metadata schemas expose the root union and normalized references."""
"""Equivalent response profiles remain valid metadata alternatives."""
target_dir = Path("/schemas")
ucp_path = str((target_dir / "ucp.json").resolve())
checkout_path = str((target_dir / "checkout.json").resolve())
Expand Down Expand Up @@ -497,8 +497,9 @@ def test_normalize_metadata_schemas_sets_root_union_and_ucp_refs(

preprocess_schemas.normalize_metadata_schemas(schemas, target_dir)

self.assertNotIn("oneOf", schemas[ucp_path])
self.assertEqual(
schemas[ucp_path]["oneOf"],
schemas[ucp_path]["anyOf"],
[
{"$ref": "#/$defs/platform_schema"},
{"$ref": "#/$defs/business_schema"},
Expand Down
Loading