From 3695edd9a4567c9a65bd6dad09c1ca77cc12abd4 Mon Sep 17 00:00:00 2001 From: frantuma Date: Wed, 6 Mar 2024 14:01:05 +0100 Subject: [PATCH] keep allOf, anyOf, oneOf alongside properties while flattening --- .../java/io/swagger/v3/parser/util/InlineModelResolver.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/InlineModelResolver.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/InlineModelResolver.java index 045697168e..6cfd900161 100644 --- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/InlineModelResolver.java +++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/InlineModelResolver.java @@ -680,6 +680,11 @@ public Schema createModelFromProperty(Schema schema, String path) { flattenProperties(properties, path); model.setProperties(properties); } + if (schema instanceof ComposedSchema){ + model.setAllOf(((ComposedSchema) schema).getAllOf()); + model.setAnyOf(((ComposedSchema) schema).getAnyOf()); + model.setOneOf(((ComposedSchema) schema).getOneOf()); + } return model; }