Skip to content

Commit bf979f6

Browse files
committed
chore(models): regenerate against the pinned 2026-08-25 UCP schema
Regenerates via ./generate_models.sh 2026-08-25 (the same command the model-drift CI job runs) to pick up the postprocessing fix in the prior commit. Three files change, all in the location_serves family: LocationServes, LocationServesCreateRequest and LocationServesUpdateRequest each gain an _enforce_max_properties validator alongside their existing _enforce_min_properties one. Verified: - Full suite: 100 tests, 0 failures, 4 documented skips (both new semantic tests from the RED commit now pass). - Double-regen: ran generate_models.sh 2026-08-25 twice; diff -rq between both outputs (excluding __pycache__) is empty. - Kill-test: reverted postprocess_models.py to its pre-fix state, regenerated, reinstalled -- the same 2 failures + 6 errors from the RED commit reappeared verbatim. Restored the fix and regenerated again to confirm the suite returns to green. - pre-commit run on the changed files: clean. Not committed: README.md, which ruff format also reformats as a pre-existing docstring-code-block spacing drift in main, unrelated to this fix (see the equivalent note on the jwk-conditional-rules branch).
1 parent 06a550f commit bf979f6

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

src/ucp_sdk/models/schemas/common/types/location_serves.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ def _enforce_min_properties(self):
8484
"At least 1 property must be provided (schema minProperties=1)"
8585
)
8686
return self
87+
88+
@model_validator(mode="after")
89+
def _enforce_max_properties(self):
90+
"""JSON Schema maxProperties: allow at most 1
91+
provided property."""
92+
provided = self.model_fields_set | set(self.model_extra or {})
93+
if len(provided) > 1:
94+
raise ValueError(
95+
"At most 1 property may be provided (schema maxProperties=1)"
96+
)
97+
return self

src/ucp_sdk/models/schemas/common/types/location_serves_create_request.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ def _enforce_min_properties(self):
8484
"At least 1 property must be provided (schema minProperties=1)"
8585
)
8686
return self
87+
88+
@model_validator(mode="after")
89+
def _enforce_max_properties(self):
90+
"""JSON Schema maxProperties: allow at most 1
91+
provided property."""
92+
provided = self.model_fields_set | set(self.model_extra or {})
93+
if len(provided) > 1:
94+
raise ValueError(
95+
"At most 1 property may be provided (schema maxProperties=1)"
96+
)
97+
return self

src/ucp_sdk/models/schemas/common/types/location_serves_update_request.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ def _enforce_min_properties(self):
8484
"At least 1 property must be provided (schema minProperties=1)"
8585
)
8686
return self
87+
88+
@model_validator(mode="after")
89+
def _enforce_max_properties(self):
90+
"""JSON Schema maxProperties: allow at most 1
91+
provided property."""
92+
provided = self.model_fields_set | set(self.model_extra or {})
93+
if len(provided) > 1:
94+
raise ValueError(
95+
"At most 1 property may be provided (schema maxProperties=1)"
96+
)
97+
return self

0 commit comments

Comments
 (0)