Skip to content

Fix #867 by intercepting spec loading#1709

Open
mromaszewicz wants to merge 3 commits into
mainfrom
fix-867-differently
Open

Fix #867 by intercepting spec loading#1709
mromaszewicz wants to merge 3 commits into
mainfrom
fix-867-differently

Conversation

@mromaszewicz

@mromaszewicz mromaszewicz commented Jul 23, 2024

Copy link
Copy Markdown
Member

This change adds a shim into the Kin loader which attempts to find an openapi or swagger version key in the spec, and returns an error if it's an unsupported version. in the case where the version can't be detected, we do nothing and behave as previously, failing in the parsing step.

Closes #867

This change adds a shim into the Kin loader which attempts to find
an `openapi` or `swagger` version key in the spec, and returns an
error if it's an unsupported version. in the case where the version
can't be detected, we do nothing and behave as previously, failing
in the parsing step.
@mromaszewicz
mromaszewicz requested a review from a team as a code owner July 23, 2024 17:19
@jamietanna

Copy link
Copy Markdown
Member

If we're doing some renaming here could we do it all (under #672) first as a separate PR?

@mromaszewicz

mromaszewicz commented Jul 23, 2024

Copy link
Copy Markdown
Member Author

If we're doing some renaming here could we do it all (under #672) first as a separate PR?

I didn't want to touch the old function in case someone is using it, so I marked it deprecated and made a new one. This isn't part of some renaming effort. My IDE linter yells at me for calling deprecated functions, hence the update to calling the new one.

Key off the error for unsupported version instead of doing
another version check.

The loader shim should not return errors, because it'll change
the behavior of the loader. Only return existing errors, don't
introduce new ones.
@mromaszewicz

Copy link
Copy Markdown
Member Author

Ok, I undid the function renaming and after some testing, fixed some issues which would have been regressions. It works as expected now on all kinds of specs.

@jamietanna
jamietanna self-requested a review August 21, 2024 21:03
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.

unexpected reference depth

2 participants