Search in sources :

Example 1 with Oas30ItemsSchema

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

the class Oas20to30TransformationVisitor method visitItemsSchema.

/**
 * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitItemsSchema(io.apicurio.datamodels.openapi.models.OasSchema)
 */
@Override
public void visitItemsSchema(OasSchema node) {
    Oas30Schema parent30 = (Oas30Schema) this.lookup(node.parent());
    Oas30ItemsSchema items30 = (Oas30ItemsSchema) parent30.createItemsSchema();
    if (!NodeCompat.isNullOrUndefined(parent30.items) && NodeCompat.isNode(parent30.items)) {
        List<Oas30ItemsSchema> items = new ArrayList<>();
        items.add(items30);
        parent30.items = items;
    } else {
        parent30.items = items30;
    }
    this.toSchema(node, items30, true);
    this.mapNode(node, items30);
}
Also used : Oas30ItemsSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30ItemsSchema) ArrayList(java.util.ArrayList) Oas30Schema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema)

Example 2 with Oas30ItemsSchema

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

the class Oas20to30TransformationVisitor method visitItems.

/**
 * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitItems(io.apicurio.datamodels.openapi.v2.models.Oas20Items)
 */
@Override
public void visitItems(Oas20Items node) {
    Oas30Schema parent30 = this.findItemsParent(node);
    Oas30ItemsSchema items30 = (Oas30ItemsSchema) parent30.createItemsSchema();
    parent30.items = items30;
    this.toSchema(node, items30, false);
    this.mapNode(node, items30);
}
Also used : Oas30ItemsSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30ItemsSchema) Oas30Schema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema)

Aggregations

Oas30Schema (io.apicurio.datamodels.openapi.v3.models.Oas30Schema)2 Oas30ItemsSchema (io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30ItemsSchema)2 ArrayList (java.util.ArrayList)1