Skip to content

fix for issue-2092 - dots lost when dereferencing files with dots - #2093

Open
simonhege wants to merge 3 commits into
swagger-api:masterfrom
simonhege:fix/issue-2092
Open

fix for issue-2092 - dots lost when dereferencing files with dots#2093
simonhege wants to merge 3 commits into
swagger-api:masterfrom
simonhege:fix/issue-2092

Conversation

@simonhege

Copy link
Copy Markdown

Fixes #2092

@wherka-ama

Copy link
Copy Markdown

@char0n , @frantuma , @kowalczyk-krzysztof, @MiloszTarka, @ponelat : apologies for pulling all of you in here, but we have no idea how to drive this. I'm sorry for the ignorance - it's entirely on me!

Any chance anyone could review this PR please? That would be really appreciated.

Thank you very much in advance!
Waldek (Amadeus OSPO)

@ewaostrowska

Copy link
Copy Markdown
Contributor

@simonhege Thank you for the contribution!
This PR cannot be merged yet because even though it fixes the schema components with dots it breaks unresolved references.

When processRefToExternalSchema(...) cannot load a schema, it returns the original external $ref. The new code always adds #/components/schemas/ so:

../models/foo.model.yaml

becomes:

#/components/schemas/../models/foo.model.yaml

That points to an internal component that does not exist. This is covered by testNestedMissingExternalSchemaRetainsOriginalRef.

The change is also not consistent across component types. Schema references now preserve dots and receive a full internal prefix, but responses, request bodies, parameters, headers, examples, and links can still produce bare references.

For example, an external response may be stored as components.responses.error.response, while its $ref remains:

error.response
instead of:

#/components/responses/error.response

These cases are shown in DottedNonSchemaComponentTest.java. They are not caused by this PR, but the shared naming change makes the inconsistency more visible.

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.

dots lost when dereferencing files with dots

3 participants