Skip to content

Conversation

@quilicicf
Copy link
Contributor

Issue

When deserializing a Swagger definition containing an inline schema, the said schema's property is not set in the object ObjectProperty.
Extract from my definition:

"paths": {
  "/path1": {
    "get": {
      "summary": "Swagger.paths.*.*.summary",
      "responses": {
        "default": {
          "description": "Swagger.paths.*.*.responses.*.description",
          "schema": {
            "type": "object",
            "description": "Swagger.paths.*.*.responses.*.schema.description",
            "properties": {
              "property1": {
                "type": "string",
                "description": "Swagger.Paths.*.*.responses.*.schema.properties.*.description"
              }
            }
          }
        }
      }
    }
  }
}

Which means the following:

Swagger swagger = Json.mapper().readValue(myFile, Swagger.class);
System.out.println(swagger.getPath("/path1").getGet().getResponses().get("default").getSchema().getDescription());

Outputs null.

fehguy added a commit that referenced this pull request Sep 30, 2015
Description lost during object property deserialization
@fehguy fehguy merged commit 0ffb0f6 into swagger-api:master Sep 30, 2015
@webron webron added this to the v1.5.4 milestone Oct 2, 2015
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