Class OpenAPIDefinition
- Author:
- jamesdbloom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static OpenAPIDefinitionopenAPI()static OpenAPIDefinitionSpecify the OpenAPI to match against by URL or payload and string as follows:static OpenAPIDefinitionSpecify the OpenAPI and operationId to match against by URL or payload and string as follows:update(OpenAPIDefinition replaceRequest) withContextPathPrefix(String contextPathPrefix) withOperationId(String operationId) Specify operationId from the OpenAPI to match against i.e.withSpecUrlOrPayload(String specUrlOrPayload) Specify the OpenAPI to match against by URL or payload as follows:Methods inherited from class org.mockserver.model.RequestDefinition
cloneWithLogCorrelationId, getLogCorrelationId, withLogCorrelationIdMethods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
OpenAPIDefinition
public OpenAPIDefinition()
-
-
Method Details
-
openAPI
-
openAPI
Specify the OpenAPI to match against by URL or payload and string as follows:// Create from a publicly hosted HTTP location (json or yaml) openAPI("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml")
// Create from a file on the local filesystem (json or yaml) openAPI("file://Users/myuser/git/mockserver/mockserver-core/src/test/resources/org/mockserver/openapi/openapi_petstore_example.json");
// Create from a classpath resource in the /api package (json or yaml) openAPI("org/mockserver/openapi/openapi_petstore_example.json");
// Create from an OpenAPI payload (json or yaml) openAPI("{\"openapi\": \"3.0.0\", \"info\": { ...")
- Parameters:
specUrlOrPayload- the OpenAPI to match against by URL or payload- Returns:
- the OpenAPIMatcher
-
openAPI
Specify the OpenAPI and operationId to match against by URL or payload and string as follows:// Create from a publicly hosted HTTP location (json or yaml) openAPI("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml", "showPetById")
// Create from a file on the local filesystem (json or yaml) openAPI("file://Users/myuser/git/mockserver/mockserver-core/src/test/resources/org/mockserver/openapi/openapi_petstore_example.json", "showPetById");
// Create from a classpath resource in the /api package (json or yaml) openAPI("org/mockserver/openapi/openapi_petstore_example.json", "showPetById");
// Create from an OpenAPI payload (json or yaml) openAPI("{\"openapi\": \"3.0.0\", \"info\": { ...", "showPetById")
- Parameters:
specUrlOrPayload- the OpenAPI to match against by URL or payloadoperationId- operationId from the OpenAPI to match against i.e. "showPetById"- Returns:
- the OpenAPIMatcher
-
getSpecUrlOrPayload
-
withSpecUrlOrPayload
Specify the OpenAPI to match against by URL or payload as follows:// Create from a publicly hosted HTTP location (json or yaml) withSpecUrlOrPayload("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml")
// Create from a file on the local filesystem (json or yaml) withSpecUrlOrPayload("file://Users/myuser/git/mockserver/mockserver-core/src/test/resources/org/mockserver/openapi/openapi_petstore_example.json");
// Create from a classpath resource in the /api package (json or yaml) withSpecUrlOrPayload("org/mockserver/openapi/openapi_petstore_example.json");
// Create from an OpenAPI payload (json or yaml) withSpecUrlOrPayload("{\"openapi\": \"3.0.0\", \"info\": { ...")
- Parameters:
specUrlOrPayload- the OpenAPI to match against by URL or payload- Returns:
- the OpenAPIMatcher
-
getOperationId
-
withOperationId
Specify operationId from the OpenAPI to match against i.e. "showPetById"- Parameters:
operationId- operationId from the OpenAPI to match against i.e. "showPetById"- Returns:
- the OpenAPIMatcher
-
getContextPathPrefix
-
withContextPathPrefix
-
shallowClone
- Specified by:
shallowClonein classRequestDefinition
-
update
-
equals
- Overrides:
equalsin classRequestDefinition
-
hashCode
public int hashCode()- Overrides:
hashCodein classRequestDefinition
-