Search in sources :

Example 1 with Oas30Responses

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

the class OasMissingResponseForOperationRule method visitResponses.

/**
 * @see io.apicurio.datamodels.combined.visitors.CombinedAllNodeVisitor#visitResponses(io.apicurio.datamodels.openapi.models.OasResponses)
 */
@Override
public void visitResponses(OasResponses node) {
    Oas30Responses response = (Oas30Responses) node;
    this.reportIfInvalid(response.getResponses().size() > 0, node.parent(), null, map());
}
Also used : Oas30Responses(io.apicurio.datamodels.openapi.v3.models.Oas30Responses)

Example 2 with Oas30Responses

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

the class Oas20to30TransformationVisitor method visitResponses.

/**
 * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponses(io.apicurio.datamodels.openapi.models.OasResponses)
 */
@Override
public void visitResponses(OasResponses node) {
    Oas30Operation parent30 = (Oas30Operation) this.lookup(node.parent());
    Oas30Responses responses30 = (Oas30Responses) parent30.createResponses();
    parent30.responses = responses30;
    this.mapNode(node, responses30);
}
Also used : Oas30Responses(io.apicurio.datamodels.openapi.v3.models.Oas30Responses) Oas30Operation(io.apicurio.datamodels.openapi.v3.models.Oas30Operation)

Example 3 with Oas30Responses

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

the class Oas20to30TransformationVisitor method visitResponse.

/**
 * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponse(io.apicurio.datamodels.openapi.models.OasResponse)
 */
@Override
public void visitResponse(OasResponse node) {
    Oas30Responses parent30 = (Oas30Responses) this.lookup(node.parent());
    Oas30Response response30 = (Oas30Response) parent30.createResponse(node.getStatusCode());
    parent30.addResponse(node.getStatusCode(), response30);
    response30.$ref = this.updateRef(node.$ref);
    this.transformResponse((Oas20Response) node, response30);
    this.mapNode(node, response30);
}
Also used : Oas30Responses(io.apicurio.datamodels.openapi.v3.models.Oas30Responses) Oas30Response(io.apicurio.datamodels.openapi.v3.models.Oas30Response)

Aggregations

Oas30Responses (io.apicurio.datamodels.openapi.v3.models.Oas30Responses)3 Oas30Operation (io.apicurio.datamodels.openapi.v3.models.Oas30Operation)1 Oas30Response (io.apicurio.datamodels.openapi.v3.models.Oas30Response)1