Reference component schemas by JSON Pointer in the published OpenAPI documents - #138
Open
tkanov wants to merge 1 commit into
Open
Reference component schemas by JSON Pointer in the published OpenAPI documents#138tkanov wants to merge 1 commit into
tkanov wants to merge 1 commit into
Conversation
Author
|
Hey @seidewitz, didn't know about the policy - should this be closed as well? Thanks! |
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.
The published OpenAPI documents reference their component schemas by JSON Schema
$idrather than by JSON Pointer, so OpenAPI tooling cannot resolve them.openapi-generator validatereports 280 errors onopenapi.json, andgenerate -g pythonexits 0 while producing no model classes at all. Reported as Systems-Modeling/SysML-v2-Release#115.In
openapi.jsonandopenapi-x.json, this rewrites the 367"$ref": "20250201/<Name>"to"#/components/schemas/<Name>"and removes the 395 schema-level$idkeys. The 2$idoccurrences that are data rather than keywords are preserved. Validation is then clean and codegen produces 557 models. Dereferencing both documents before and after gives the same effective schema throughout, so only the reference form changes.Three things for you to decide.
$idvalues came from PR ST5AS-226 Align JSON Schema and OpenAPI spec with OMG URI standard #93 (ST5AS-226) for OMG URI identity, and for most schemas are not recoverable from the patched document. I can instead keep$idon schemas that are never a reference target.conf/json/schemaon each baseline update, for example PR ST5AS-246 update to 2025-02 metamodel baseline #127, so the generator needs the same change or this reverts./docsservesopenapi-sans-schemas.json, whose emptycomponents.schemasproduces the 62 errors quoted in that issue. I left it alone because I cannot test how RapiDoc resolves references across files. Pointindex.htmlat the full document, or make the reduced one self-contained?conf/json/schema/**is untouched, since its$idbased references are valid JSON Schema andFlatSchemaDaokeys the/schemasendpoint on$id. Issues #106 and #108 are separate.