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

Fix NPE with unnamed schemas in {one,any,all}-of #220

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

gsdatta
Copy link
Contributor

@gsdatta gsdatta commented Mar 23, 2021

Fixes #176

Comment on lines +98 to +100
result.putAll(getUnnamedSchemas(composedSchema.getAllOf(), "all-of"));
result.putAll(getUnnamedSchemas(composedSchema.getOneOf(), "one-of"));
result.putAll(getUnnamedSchemas(composedSchema.getAnyOf(), "any-of"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick and dirty workaround - naming the unnamed schemas in order of their appearance in the list.

Comment on lines +132 to +134
if (schemas == null) {
return result;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list is sometimes null (in the diff case) which throws nullptr

@gsdatta
Copy link
Contributor Author

gsdatta commented Mar 23, 2021

@joschi another fix! this has been throwing a ton of null pointers for us in production so thought I'd put in a quick fix. Would love a review/release!

@gsdatta
Copy link
Contributor Author

gsdatta commented Apr 20, 2021

Hey @joschi! Any chance we could get a review+release of this? It's been pretty noisy in our diffs, would like to avoid forking if possible 😢

Copy link
Contributor

@joschi joschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsdatta Sorry for the delay. The PR looks good to me. 👍

Thanks a lot for your contribution!

@joschi joschi added the bug label Apr 23, 2021
@joschi joschi added this to the Release 2.0.0 milestone Apr 23, 2021
@joschi joschi changed the title Fix null pointer exceptions with unnamed schemas in *of Fix NPE with unnamed schemas in {one,any,all}-of Apr 23, 2021
@joschi joschi merged commit 2a8648c into OpenAPITools:master Apr 23, 2021
@gsdatta gsdatta deleted the schema-oneof branch April 23, 2021 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support oneOf without $ref references
2 participants