@@ -236,16 +236,9 @@ private String schema(int deepness, ComposedSchema schema) {
236236 if (schema .getAllOf () != null && schema .getAllOf () != null ) {
237237 LOGGER .debug ("All of schema" );
238238 schema .getAllOf ().stream ()
239- .map (schema1 -> refPointer . resolveRef ( diff . getNewSpecOpenApi (). getComponents (), schema1 , schema1 . get$ref ()) )
239+ .map (this :: resolve )
240240 .forEach (composedChild -> sb .append (schema (deepness , composedChild )));
241241 }
242- // if (schema.getOneOf() != null && schema.getOneOf() != null) {
243- // LOGGER.debug("One of schema");
244- // sb.append(format("%sOne of:\n\n", indent(deepness)));
245- // schema.getOneOf().stream()
246- // .map(schema1 -> refPointer.resolveRef(diff.getNewSpecOpenApi().getComponents(), schema1, schema1.get$ref()))
247- // .forEach(composedChild -> sb.append(schema(deepness + 1, composedChild)));
248- // }
249242 return sb .toString ();
250243 }
251244
@@ -256,7 +249,7 @@ private String schema(int deepness, Schema schema) {
256249 if (schema instanceof ComposedSchema ) {
257250 sb .append (schema (deepness , (ComposedSchema ) schema ));
258251 } else if (schema instanceof ArraySchema ) {
259- sb .append (items (deepness , (( ArraySchema ) schema ).getItems ()));
252+ sb .append (items (deepness , resolve ((( ArraySchema ) schema ).getItems () )));
260253 }
261254 return sb .toString ();
262255 }
@@ -273,9 +266,9 @@ private String properties(final int deepness, String title, Map<String, Schema>
273266 StringBuilder sb = new StringBuilder ("" );
274267 if (properties != null ) {
275268 properties .forEach ((key , value ) -> {
276- sb .append (property (deepness , title , key , value ));
269+ sb .append (property (deepness , title , key , resolve ( value ) ));
277270 if (showContent ) {
278- sb .append (schema (deepness + 1 , value ));
271+ sb .append (schema (deepness + 1 , resolve ( value ) ));
279272 }
280273 });
281274 }
@@ -386,4 +379,8 @@ private String indent(int deepness) {
386379 }
387380 return sb .toString ();
388381 }
382+
383+ private Schema resolve (Schema schema ) {
384+ return refPointer .resolveRef (diff .getNewSpecOpenApi ().getComponents (), schema , schema .get$ref ());
385+ }
389386}
0 commit comments