private JsonNode normalizeToJsonInternal(URL resolutionBase) throws GenerationException { if (spec != null) { return new OpenApiReferenceProcessor(options).of(spec).inline(resolutionBase); } else if (tree != null) { return new OpenApiReferenceProcessor(options).of(tree).inline(resolutionBase); } else { throw new IllegalStateException("Cannot call normalize() before supplying a model spec"); } }
private ObjectNode buildObjectTree() { ObjectNode tree = JsonNodeFactory.instance.objectNode(); while (true) { Optional<LocalContent> optItem = contentManager.getAndRemoveRetainedModelObject(); if (optItem.isPresent()) { LocalContent item = optItem.get(); JsonNode object = Util.safeDeepCopy(item.getContent()); object = inline(object, item.getRef()); OpenApiMarkers.markPosition(object, item.getPosition()); addToTree(tree, object, item.getSectionType(), item.getName()); addJsonPointers(object, item.getRef()); } else { break; } } return tree; }