public class OpenAPIDefinition extends RequestDefinition
Constructor and Description |
---|
OpenAPIDefinition() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getOperationId() |
String |
getSpecUrlOrPayload() |
int |
hashCode() |
static OpenAPIDefinition |
openAPI() |
static OpenAPIDefinition |
openAPI(String specUrlOrPayload)
Specify the OpenAPI to match against by URL or payload and string as follows:
|
static OpenAPIDefinition |
openAPI(String specUrlOrPayload,
String operationId)
Specify the OpenAPI and operationId to match against by URL or payload and string as follows:
|
OpenAPIDefinition |
shallowClone() |
OpenAPIDefinition |
update(OpenAPIDefinition replaceRequest) |
OpenAPIDefinition |
withOperationId(String operationId)
Specify operationId from the OpenAPI to match against i.e.
|
OpenAPIDefinition |
withSpecUrlOrPayload(String specUrlOrPayload)
Specify the OpenAPI to match against by URL or payload as follows:
|
cloneWithLogCorrelationId, getLogCorrelationId, withLogCorrelationId
toString
fieldsExcludedFromEqualsAndHashCode
public static OpenAPIDefinition openAPI()
public static OpenAPIDefinition openAPI(String specUrlOrPayload)
// 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/mock/openapi_petstore_example.json");
// Create from a classpath resource in the /api package (json or yaml) openAPI("org/mockserver/mock/openapi_petstore_example.json");
// Create from an OpenAPI payload (json or yaml) openAPI("{\"openapi\": \"3.0.0\", \"info\": { ...")
specUrlOrPayload
- the OpenAPI to match against by URL or payloadpublic static OpenAPIDefinition openAPI(String specUrlOrPayload, String operationId)
// 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/mock/openapi_petstore_example.json", "showPetById");
// Create from a classpath resource in the /api package (json or yaml) openAPI("org/mockserver/mock/openapi_petstore_example.json", "showPetById");
// Create from an OpenAPI payload (json or yaml) openAPI("{\"openapi\": \"3.0.0\", \"info\": { ...", "showPetById")
specUrlOrPayload
- the OpenAPI to match against by URL or payloadoperationId
- operationId from the OpenAPI to match against i.e. "showPetById"public String getSpecUrlOrPayload()
public OpenAPIDefinition withSpecUrlOrPayload(String specUrlOrPayload)
// 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/mock/openapi_petstore_example.json");
// Create from a classpath resource in the /api package (json or yaml) withSpecUrlOrPayload("org/mockserver/mock/openapi_petstore_example.json");
// Create from an OpenAPI payload (json or yaml) withSpecUrlOrPayload("{\"openapi\": \"3.0.0\", \"info\": { ...")
specUrlOrPayload
- the OpenAPI to match against by URL or payloadpublic String getOperationId()
public OpenAPIDefinition withOperationId(String operationId)
operationId
- operationId from the OpenAPI to match against i.e. "showPetById"public OpenAPIDefinition shallowClone()
shallowClone
in class RequestDefinition
public OpenAPIDefinition update(OpenAPIDefinition replaceRequest)
public boolean equals(Object o)
equals
in class RequestDefinition
public int hashCode()
hashCode
in class RequestDefinition
Copyright © 2020. All rights reserved.