Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when the same component used in two different places in two different apis then parser fails #1627

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ptrsd
Copy link
Contributor

@ptrsd ptrsd commented Nov 17, 2021

Hi, I'm getting ClassCastException when the same parameter from $ref is used in different places in different APIs. In this PR I've added a test case for this problem.

Exception:

java.lang.ClassCastException: Cannot cast io.swagger.v3.oas.models.headers.Header to io.swagger.v3.oas.models.parameters.Parameter
	at java.base/java.lang.Class.cast(Class.java:3816)
	at io.swagger.v3.parser.ResolverCache.loadRef(ResolverCache.java:116)
	at io.swagger.v3.parser.processors.ParameterProcessor.processParameters(ParameterProcessor.java:86)
	at io.swagger.v3.parser.processors.OperationProcessor.processOperation(OperationProcessor.java:39)
	at io.swagger.v3.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:84)
	at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:49)
	at io.swagger.v3.parser.OpenAPIV3Parser.resolve(OpenAPIV3Parser.java:183)
	at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:162)
	at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:99)

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.

None yet

2 participants