Fix #437: unpin openapi-spec-validator and fix ximportresources OpenAPI paths#464
Merged
Merged
Conversation
clemensv
force-pushed
the
clemensv/issue437
branch
2 times, most recently
from
May 18, 2026 15:39
eac2316 to
eadbc6f
Compare
…ces OpenAPI paths
The pin to openapi-spec-validator==0.8.0 was masking real bugs in schema-generator.py. The newer validator's path-parameter resolution check exposed four OpenAPI paths generated for ximportresources that were missing the {resourceid} segment (meta, $details, versions, and versions/{versionid}). Fixed those paths and unpinned the dependency to >=0.7.1.
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
clemensv
force-pushed
the
clemensv/issue437
branch
from
May 18, 2026 15:39
eadbc6f to
03e7d5c
Compare
Contributor
|
Approved on 5/20 call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #437.
Issue
The pin
openapi-spec-validator==0.8.0intools/requirements.txtwas in place because anything higher broke the test suite. Investigation showed the newer versions weren't actually broken — they were correctly catching pre-existing bugs intools/schema-generator.pythat the older release silently let through.With
openapi-spec-validator>=0.8.1(current latest: 0.8.5), the OpenAPI path-parameter resolution check raises:Root cause
In
generate_openapi(...), the loops that emit paths for a group's ownresourcescorrectly include{resourceid}in the URL template. The mirrored loops forximportresources(resources imported from another group) were dropping the{resourceid}segment for four templates, producing paths whose operations referenced an undefined path parameter:/{group}/{groupid}/{ximpres}/meta/{group}/{groupid}/{ximpres}/{resourceid}/meta/{group}/{groupid}/{ximpres}$details/{group}/{groupid}/{ximpres}/{resourceid}$details/{group}/{groupid}/{ximpres}/versions/{group}/{groupid}/{ximpres}/{resourceid}/versions/{group}/{groupid}/{ximpres}/versions/{versionid}/{group}/{groupid}/{ximpres}/{resourceid}/versions/{versionid}The non-imported
resourcesbranches already had the correct URLs; the bug only affected theximportresourcesbranches.Fix
tools/schema-generator.py: add the missing{resourceid}segment to the fourximportresourcespath templates so the emitted OpenAPI documents are valid.tools/requirements.txt: replaceopenapi-spec-validator==0.8.0withopenapi-spec-validator>=0.7.1, allowing the latest validator.Validation
python -m pytest test_schema_generator.pyagainstopenapi-spec-validator==0.8.5: 22 passed.