1515import org .slf4j .Logger ;
1616import org .slf4j .LoggerFactory ;
1717
18+ import java .util .Arrays ;
1819import java .util .List ;
1920import java .util .Map ;
2021
@@ -238,6 +239,13 @@ private String schema(int deepness, ComposedSchema schema) {
238239 .map (schema1 -> refPointer .resolveRef (diff .getNewSpecOpenApi ().getComponents (), schema1 , schema1 .get$ref ()))
239240 .forEach (composedChild -> sb .append (schema (deepness , composedChild )));
240241 }
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+ // }
241249 return sb .toString ();
242250 }
243251
@@ -247,10 +255,20 @@ private String schema(int deepness, Schema schema) {
247255 sb .append (properties (deepness , "Property" , schema .getProperties (), true ));
248256 if (schema instanceof ComposedSchema ) {
249257 sb .append (schema (deepness , (ComposedSchema ) schema ));
258+ } else if (schema instanceof ArraySchema ) {
259+ sb .append (items (deepness , ((ArraySchema ) schema ).getItems ()));
250260 }
251261 return sb .toString ();
252262 }
253263
264+ private String items (int deepness , Schema schema ) {
265+ StringBuilder sb = new StringBuilder ("" );
266+ sb .append (format ("%sItems (%s)%s\n " , indent (deepness ), type (schema ), Arrays .asList ("object" , "array" ).contains (type (schema )) ? " :\n " : "" ));
267+ description (indent (deepness + 1 ), schema .getDescription ());
268+ sb .append (schema (deepness , schema ));
269+ return sb .toString ();
270+ }
271+
254272 private String properties (final int deepness , String title , Map <String , Schema > properties , boolean showContent ) {
255273 StringBuilder sb = new StringBuilder ("" );
256274 if (properties != null ) {
@@ -276,11 +294,11 @@ private String property(int deepness, String name, ChangedSchema schema) {
276294 }
277295
278296 private String property (int deepness , String title , String name , Schema schema ) {
279- return property (deepness , title , name , schema . getType ( ), schema .getDescription ());
297+ return property (deepness , title , name , type ( schema ), schema .getDescription ());
280298 }
281299
282300 private String property (int deepness , String title , String name , String type , String description ) {
283- return format ("%s* %s `%s` (%s)\n %s\n " , indent (deepness ), title , name , type == null ? "object" : type , description (indent (deepness + 1 ), description ));
301+ return format ("%s* %s `%s` (%s)\n %s\n " , indent (deepness ), title , name , type , description (indent (deepness + 1 ), description ));
284302 }
285303
286304 private String listDiff (int deepness , String name , ListDiff listDiff ) {
0 commit comments