Skip to content

Conversation

@joeljons
Copy link
Contributor

According to how i interpret the spec the "components" object is not required. I wish it were! (Or at least default to an empty components object) I have had so some bugs where I assume components exists...

According to the deserializer it assumes it is required. (The true means it is required)

obj = getObject("components", rootNode, true, location, result);

This PR fixes a NPE in the resolver when the spec is missing the components tag and using external refs. I haven't checked, but I wouldn't be surprised if there are other cases of openAPI.getComponents().getSomeSubObject() assuming components is not null. Maybe thinking about defaulting the root components to an empty object is worth thinking about...

@webron webron requested a review from gracekarina November 13, 2017 23:35
Copy link
Contributor

@gracekarina gracekarina left a comment

Choose a reason for hiding this comment

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

Hi! @joeljons, you are right, according to the spec the components tag is not required, so I think it is better to start changing the "true" to "false" in the deserializer and see what happens after that. We could validate the components object not being null in those places that we might missed. Thanks.

@joeljons joeljons force-pushed the refering-without-components branch from b233388 to 7a29793 Compare November 22, 2017 12:44
@joeljons
Copy link
Contributor Author

@gracekarina Do you want me to do that here in this PR? Or will you do it separately?

@joeljons
Copy link
Contributor Author

@gracekarina It wasn't that many places so I went ahead and did it.

@gracekarina
Copy link
Contributor

Thanks @joeljons

@frantuma frantuma merged commit dfb6ace into swagger-api:2.0 Nov 22, 2017
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.

3 participants