Search in sources :

Example 1 with Oas20to30TransformationVisitor

use of io.apicurio.datamodels.openapi.visitors.transform.Oas20to30TransformationVisitor in project apicurio-data-models by Apicurio.

the class Library method transformDocument.

/**
 * Transforms from an OpenAPI 2.0 document into a 3.0 document.
 * @param source
 */
public static Oas30Document transformDocument(Oas20Document source) {
    Oas20Document clone = (Oas20Document) cloneDocument(source);
    Oas20to30TransformationVisitor transformer = new Oas20to30TransformationVisitor();
    VisitorUtil.visitTree(clone, transformer, TraverserDirection.down);
    return transformer.getResult();
}
Also used : Oas20Document(io.apicurio.datamodels.openapi.v2.models.Oas20Document) Oas20to30TransformationVisitor(io.apicurio.datamodels.openapi.visitors.transform.Oas20to30TransformationVisitor)

Aggregations

Oas20Document (io.apicurio.datamodels.openapi.v2.models.Oas20Document)1 Oas20to30TransformationVisitor (io.apicurio.datamodels.openapi.visitors.transform.Oas20to30TransformationVisitor)1