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

SpecFilter throws NPE on invalid definition reference #1929

Closed
fehguy opened this issue Sep 14, 2016 · 0 comments
Closed

SpecFilter throws NPE on invalid definition reference #1929

fehguy opened this issue Sep 14, 2016 · 0 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented Sep 14, 2016

A definition like such:

{
  "swagger": "2.0",
  "info": {
    "description": "This is a sample server Petstore server.  You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger.  For this sample, you can use the api key \"special-key\" to test the authorization filters",
    "version": "1.0.0",
    "title": "Swagger Petstore",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "email": "[email protected]"
    }
  },
  "paths": {
    "/pet": {
      "get": {
        "parameters": [],
        "responses": {
          "default": {
            "description": "successful operation",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResponseModel"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Foo": {
      "type": "object"
    }
  }
}

Will cause a NPE in the SpecFilter because there's no value to resolve to.

surajchhetry added a commit to surajchhetry/swagger-core that referenced this issue Sep 15, 2016
fehguy added a commit to swagger-api/swagger-inflector that referenced this issue Sep 20, 2016
@fehguy fehguy closed this as completed Dec 24, 2016
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

No branches or pull requests

1 participant