Skip to content

Fix contradictory UploadFilePartInstruction schema - #42

Open
ActiveInAI wants to merge 1 commit into
buildingSMART:release_1_0from
ActiveInAI:fix/upload-file-part-instruction-schema
Open

ActiveInAI wants to merge 1 commit into
buildingSMART:release_1_0from
ActiveInAI:fix/upload-file-part-instruction-schema

Conversation

@ActiveInAI

Copy link
Copy Markdown

UploadFilePartInstruction currently rejects every valid upload instruction under strict schema validation. Its allOf references LinkData, which allows only url and sets additionalProperties: false. The other branch requires http_method, content_range_start, and content_range_end; these required fields are therefore simultaneously forbidden by the first branch.

For example, the current schema rejects:

{
  "url": "https://cde.example.test/upload/part/1",
  "http_method": "PUT",
  "content_range_start": 0,
  "content_range_end": 1023
}

This change defines UploadFilePartInstruction as a single closed object containing all its existing fields. It preserves every property constraint, required field, description, reference, and default, and keeps LinkData unchanged and closed. No endpoint, payload field name, or API version changes. Flattening the model can affect inheritance in generated client types, although the intended JSON payload is unchanged.

The regression tests cover POST and PUT, optional properties, the enclosing DocumentsToUpload response, missing required fields, invalid values, unknown fields, and unchanged LinkData validation. They use the Draft 4-compatible JSON Schema subset of these OpenAPI 3.0 models; this is not a claim of complete OpenAPI validation.

Validation with Python 3.14.4, jsonschema 4.26.0, and PyYAML 6.0.3:

python -m unittest discover -s tests -v
# Before: 9 tests, 4 validation errors on valid payloads (including subtests).
# After:  9 tests, OK.
git diff --check
# Clean.

Only swagger.yaml and the focused regression test are changed. No dependency manifest or workflow changes are included.

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