Skip to content

Commit 9229016

Browse files
zhrc0073zhrc0073
authored andcommitted
Allowing inheritance without additionnal properties
1 parent 8a10e20 commit 9229016

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/swagger-core/src/main/java/io/swagger/util/ModelDeserializer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ public Model deserialize(JsonParser jp, DeserializationContext ctxt)
3131
// we only support one parent, no multiple inheritance or composition
3232
model = Json.mapper().convertValue(node, ComposedModel.class);
3333
List<Model> allComponents = model.getAllOf();
34-
if (allComponents.size() >= 2) {
34+
if (allComponents.size() >= 1) {
3535
model.setParent(allComponents.get(0));
36-
model.setChild(allComponents.get(allComponents.size() - 1));
36+
model.setChild(new ModelImpl());
3737
}
3838
if (allComponents.size() >= 2) {
39+
model.setChild(allComponents.get(allComponents.size() - 1));
3940
List<RefModel> interfaces = new ArrayList<RefModel>();
4041
int size = allComponents.size();
4142
for (Model m : allComponents.subList(1, size - 1)) {

0 commit comments

Comments
 (0)