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

NPE in SpecFilter.filterDefinitions() #1141

Closed
csuich2 opened this issue Jun 8, 2015 · 1 comment
Closed

NPE in SpecFilter.filterDefinitions() #1141

csuich2 opened this issue Jun 8, 2015 · 1 comment
Labels
Milestone

Comments

@csuich2
Copy link

csuich2 commented Jun 8, 2015

When attempting to upgrade to 1.5.0-M2, I found that some of our models were causing a NPE to be thrown in SpecFilter.filterDefinitions. The culprit models were those that have no properties added to the ModelImpl. A simple example of this is a model which has an int[][] as a field which in turn has its own ModelImpl created.

It appears that SpecFilter.filterDefinitions() either:

  1. Has an assumed precondition that all models have a non-null property list
  2. Simply fails to check for non-null before attempting to retrieve the property iterator.

Since the rest of the library works just fine with models that have no properties, I believe a non-null check is simply missing. I have a pull request incoming shortly that I believe addresses the issue.

csuich2 pushed a commit to csuich2/swagger-core that referenced this issue Jun 8, 2015
csuich2 pushed a commit to csuich2/swagger-core that referenced this issue Jul 9, 2015
webron added a commit that referenced this issue Jul 9, 2015
Fix for #1141 - SpecFilter.filterDefinitions() throwing NPE
@webron
Copy link
Contributor

webron commented Jul 9, 2015

Fixed in develop_2.0.

@webron webron closed this as completed Jul 9, 2015
@webron webron added this to the v1.5.1 milestone Jul 9, 2015
@webron webron added the Bug label Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants