@@ -2132,43 +2132,7 @@ private boolean resolveSubtypes(Schema model, BeanDescription bean, ModelConvert
21322132 ComposedSchema composedSchema = null ;
21332133 if (!(subtypeModel instanceof ComposedSchema )) {
21342134 // create composed schema
2135- // TODO #2312 - smarter way needs clone implemented in #2227
2136- composedSchema = (ComposedSchema ) new ComposedSchema ()
2137- .title (subtypeModel .getTitle ())
2138- .name (subtypeModel .getName ())
2139- .deprecated (subtypeModel .getDeprecated ())
2140- .additionalProperties (subtypeModel .getAdditionalProperties ())
2141- .description (subtypeModel .getDescription ())
2142- .discriminator (subtypeModel .getDiscriminator ())
2143- .exclusiveMaximum (subtypeModel .getExclusiveMaximum ())
2144- .exclusiveMinimum (subtypeModel .getExclusiveMinimum ())
2145- .externalDocs (subtypeModel .getExternalDocs ())
2146- .format (subtypeModel .getFormat ())
2147- .maximum (subtypeModel .getMaximum ())
2148- .maxItems (subtypeModel .getMaxItems ())
2149- .maxLength (subtypeModel .getMaxLength ())
2150- .maxProperties (subtypeModel .getMaxProperties ())
2151- .minimum (subtypeModel .getMinimum ())
2152- .minItems (subtypeModel .getMinItems ())
2153- .minLength (subtypeModel .getMinLength ())
2154- .minProperties (subtypeModel .getMinProperties ())
2155- .multipleOf (subtypeModel .getMultipleOf ())
2156- .not (subtypeModel .getNot ())
2157- .nullable (subtypeModel .getNullable ())
2158- .pattern (subtypeModel .getPattern ())
2159- .properties (subtypeModel .getProperties ())
2160- .readOnly (subtypeModel .getReadOnly ())
2161- .required (subtypeModel .getRequired ())
2162- .type (subtypeModel .getType ())
2163- .uniqueItems (subtypeModel .getUniqueItems ())
2164- .writeOnly (subtypeModel .getWriteOnly ())
2165- .xml (subtypeModel .getXml ())
2166- .extensions (subtypeModel .getExtensions ());
2167-
2168- if (subtypeModel .getExample () != null || subtypeModel .getExampleSetFlag ()) {
2169- composedSchema .example (subtypeModel .getExample ());
2170- }
2171- composedSchema .setEnum (subtypeModel .getEnum ());
2135+ composedSchema = ComposedSchema .from (subtypeModel );
21722136 } else {
21732137 composedSchema = (ComposedSchema ) subtypeModel ;
21742138 }
0 commit comments