T - the OpenAPI document type representing version 2.x or 3.x.O - the OpenAPI operation type.public interface DataShapeGenerator<T extends io.apicurio.datamodels.openapi.models.OasDocument,O extends io.apicurio.datamodels.openapi.models.OasOperation>
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataShapeGenerator.NameAndSchema
Combination of schema and name for request body.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_JSON |
static String |
APPLICATION_XML |
static DataShape |
DATA_SHAPE_NONE |
| Modifier and Type | Method and Description |
|---|---|
DataShape |
createShapeFromRequest(com.fasterxml.jackson.databind.node.ObjectNode json,
T openApiDoc,
O operation) |
DataShape |
createShapeFromResponse(com.fasterxml.jackson.databind.node.ObjectNode json,
T openApiDoc,
O operation) |
default Optional<DataShapeGenerator.NameAndSchema> |
findBodySchema(T openApiDoc,
O operation)
Find schema that is specified to define the body if any.
|
default <R extends io.apicurio.datamodels.openapi.models.OasResponse> |
findResponse(T openApiDoc,
O operation,
Predicate<R> hasSchema,
Class<R> responseType)
Find response for given operation.
|
default List<io.apicurio.datamodels.openapi.models.OasResponse> |
resolveResponses(T openApiDoc,
List<io.apicurio.datamodels.openapi.models.OasResponse> operationResponses)
Method resolves response references in given list of operation responses.
|
static final String APPLICATION_JSON
static final String APPLICATION_XML
static final DataShape DATA_SHAPE_NONE
DataShape createShapeFromRequest(com.fasterxml.jackson.databind.node.ObjectNode json, T openApiDoc, O operation)
DataShape createShapeFromResponse(com.fasterxml.jackson.databind.node.ObjectNode json, T openApiDoc, O operation)
default Optional<DataShapeGenerator.NameAndSchema> findBodySchema(T openApiDoc, O operation)
openApiDoc - the OpenAPI document.operation - maybe holding a body schema.default <R extends io.apicurio.datamodels.openapi.models.OasResponse> Optional<R> findResponse(T openApiDoc, O operation, Predicate<R> hasSchema, Class<R> responseType)
R - type of the response to return.openApiDoc - the OpenAPI document.operation - the operation holding some response definitions.hasSchema - predicate checks that response has a schema defined.responseType - the target response type.default List<io.apicurio.datamodels.openapi.models.OasResponse> resolveResponses(T openApiDoc, List<io.apicurio.datamodels.openapi.models.OasResponse> operationResponses)
openApiDoc - the OpenAPI document.operationResponses - the responses for an operation.Copyright © 2016–2021 Red Hat. All rights reserved.