diff --git a/modules/swagger-core/src/main/java/io/swagger/util/PropertyDeserializer.java b/modules/swagger-core/src/main/java/io/swagger/util/PropertyDeserializer.java index f7c7ff4f14..78d6477ba2 100644 --- a/modules/swagger-core/src/main/java/io/swagger/util/PropertyDeserializer.java +++ b/modules/swagger-core/src/main/java/io/swagger/util/PropertyDeserializer.java @@ -167,7 +167,7 @@ Property propertyFromNode(JsonNode node) { properties.put(field.getKey(), property); } } - ObjectProperty objectProperty = new ObjectProperty(properties); + ObjectProperty objectProperty = new ObjectProperty(properties).description(description); objectProperty.setVendorExtensionMap(getVendorExtensions(node)); return objectProperty; } diff --git a/modules/swagger-models/src/main/java/io/swagger/models/properties/ObjectProperty.java b/modules/swagger-models/src/main/java/io/swagger/models/properties/ObjectProperty.java index 5291503ab3..40b33b0baa 100644 --- a/modules/swagger-models/src/main/java/io/swagger/models/properties/ObjectProperty.java +++ b/modules/swagger-models/src/main/java/io/swagger/models/properties/ObjectProperty.java @@ -31,6 +31,11 @@ public ObjectProperty properties(Map properties) { return this; } + public ObjectProperty description(String description) { + this.setDescription(description); + return this; + } + public Map getProperties(){ return this.properties; }