Interface OpenAPIContract
public interface OpenAPIContract
-
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAPIContractBuilderInstantiates a new builder for an openapi-contract.findOperation(String urlPath, HttpMethod method) Finds the relatedOperationobject based on the passed url path and method.Finds the relatedPathobject based on the passed url path.static Future<OpenAPIContract> from(Vertx vertx, JsonObject contract) Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.static Future<OpenAPIContract> from(Vertx vertx, JsonObject contract, Map<String, JsonObject> additionalContractParts) Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.static Future<OpenAPIContract> Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.static Future<OpenAPIContract> Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.getPaths()Returns the applicable list of global security requirements (scopes) or empty list.Access to an operation defined in the contract withoperationId.securityScheme(String name) Gets the relatedSecuritySchemeobject based on the passed name.
-
Method Details
-
builder
Instantiates a new builder for an openapi-contract.- Parameters:
vertx- The vert.x instance- Returns:
- A new builder.
-
from
Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.- Parameters:
vertx- The related Vert.x instance.contractPath- The path to the contract.- Returns:
- A succeeded
Futureholding anOpenAPIContractinstance, otherwise a failedFuture.
-
from
Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.- Parameters:
vertx- The related Vert.x instance.contract- The contract.- Returns:
- A succeeded
Futureholding anOpenAPIContractinstance, otherwise a failedFuture.
-
from
static Future<OpenAPIContract> from(Vertx vertx, String contractPath, Map<String, String> additionalContractPartPaths) Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.This method can be used in case that the contract is split into several parts. These parts can be passed in a Map that has the reference as key and the path to the part as value.
- Parameters:
vertx- The related Vert.x instance.contractPath- The path to the contract.additionalContractPartPaths- The additional contract part paths- Returns:
- A succeeded
Futureholding anOpenAPIContractinstance, otherwise a failedFuture.
-
from
static Future<OpenAPIContract> from(Vertx vertx, JsonObject contract, Map<String, JsonObject> additionalContractParts) Resolves / dereferences the passed contract and creates anOpenAPIContractinstance.This method can be used in case that the contract is split into several parts. These parts can be passed in a Map that has the reference as key and the part as value.
- Parameters:
vertx- The related Vert.x instance.contract- The unresolved contract.additionalContractParts- The additional contract parts- Returns:
- A succeeded
Futureholding anOpenAPIContractinstance, otherwise a failedFuture.
-
operation
Access to an operation defined in the contract withoperationId.- Parameters:
operationId- the id of the operation.- Returns:
- the requested operation.
- Throws:
IllegalArgumentException- if the operation id doesn't exist in the contract.
-
operations
-
getPaths
-
getRawContract
JsonObject getRawContract()- Returns:
- the resolved OpenAPI contract as
JsonObject.
-
getVersion
OpenAPIVersion getVersion()- Returns:
- the OpenAPI version of the contract.
-
getSchemaRepository
SchemaRepository getSchemaRepository()- Returns:
- the
SchemaRepositoryto validate against.
-
getServers
-
findPath
-
findOperation
Finds the relatedOperationobject based on the passed url path and method. -
getSecurityRequirements
List<SecurityRequirement> getSecurityRequirements()Returns the applicable list of global security requirements (scopes) or empty list.- Returns:
- The related security requirement.
-
securityScheme
Gets the relatedSecuritySchemeobject based on the passed name.- Parameters:
name- The name of the security scheme.- Returns:
- the found
SecuritySchemeobject, or null if the passed path and method doesn't match anyOperationobject.
-