Search in sources :

Example 1 with Oas30AllOfSchema

use of io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AllOfSchema in project apicurio-data-models by Apicurio.

the class Oas20to30TransformationVisitor method visitAllOfSchema.

/**
 * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitAllOfSchema(io.apicurio.datamodels.openapi.models.OasSchema)
 */
@Override
public void visitAllOfSchema(OasSchema node) {
    Oas30Schema parent30 = (Oas30Schema) this.lookup(node.parent());
    Oas30AllOfSchema allOf30 = (Oas30AllOfSchema) parent30.createAllOfSchema();
    if (NodeCompat.isNullOrUndefined(parent30.allOf)) {
        parent30.allOf = new ArrayList<>();
    }
    parent30.allOf.add(allOf30);
    this.toSchema(node, allOf30, true);
    this.mapNode(node, allOf30);
}
Also used : Oas30AllOfSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AllOfSchema) Oas30Schema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema)

Aggregations

Oas30Schema (io.apicurio.datamodels.openapi.v3.models.Oas30Schema)1 Oas30AllOfSchema (io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AllOfSchema)1