-
public final class OpenApiDocumentation
OpenApiDocumentation contains OpenAPI documentation for a Handler.
This class should be modified by the available functions and passed into io.javalin.plugin.openapi.dsl.documented which will include it in the generated documentation.
-
-
Field Summary
Fields Modifier and Type Field Description private Boolean
isIgnored
private final List<OpenApiUpdater<Operation>>
operationUpdaterList
private final List<OpenApiUpdater<RequestBody>>
requestBodyList
private final Map<String, List<OpenApiUpdater<Parameter>>>
parameterUpdaterListMapping
private final Map<String, List<OpenApiUpdater<ApiResponse>>>
responseUpdaterListMapping
private final List<OpenApiUpdater<Components>>
componentsUpdaterList
private final List<DocumentedFormParameter>
formParameterList
private final List<DocumentedFileUpload>
fileUploadList
-
Constructor Summary
Constructors Constructor Description OpenApiDocumentation()
-
Method Summary
Modifier and Type Method Description final Boolean
getIsIgnored()
final Unit
setIsIgnored(Boolean isIgnored)
final List<OpenApiUpdater<Operation>>
getOperationUpdaterList()
final List<OpenApiUpdater<RequestBody>>
getRequestBodyList()
final Map<String, List<OpenApiUpdater<Parameter>>>
getParameterUpdaterListMapping()
final Map<String, List<OpenApiUpdater<ApiResponse>>>
getResponseUpdaterListMapping()
final List<OpenApiUpdater<Components>>
getComponentsUpdaterList()
final List<DocumentedFormParameter>
getFormParameterList()
final List<DocumentedFileUpload>
getFileUploadList()
final Boolean
hasRequestBodies()
final Boolean
hasResponses()
final Boolean
hasFormParameter()
final Boolean
hasFileUploads()
final OpenApiDocumentation
ignore(Boolean isIgnored)
Hide the endpoint in the documentation final OpenApiDocumentation
ignore()
Hide the endpoint in the documentation final OpenApiDocumentation
operation(Function1<Operation, Unit> applyUpdates)
Documents the handler using the Operation provided by the input applyUpdates. final OpenApiDocumentation
operation(OpenApiUpdater<Operation> openApiUpdater)
Documents the handler using the Operation provided by the input openApiUpdater. final OpenApiDocumentation
pathParam(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a path parameter. final OpenApiDocumentation
pathParam(String name, Class<?> clazz)
Documents that the handler can receive a path parameter. final OpenApiDocumentation
queryParam(String name, Class<?> clazz, Boolean isRepeatable, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a query parameter. final OpenApiDocumentation
queryParam(String name, Class<?> clazz, Boolean isRepeatable)
Documents that the handler can receive a query parameter. final OpenApiDocumentation
queryParam(String name, Class<?> clazz)
Documents that the handler can receive a query parameter. final OpenApiDocumentation
header(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler has a header. final OpenApiDocumentation
header(String name, Class<?> clazz)
Documents that the handler has a header. final OpenApiDocumentation
cookie(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a cookie. final OpenApiDocumentation
cookie(String name, Class<?> clazz)
Documents that the handler can receive a cookie. final OpenApiDocumentation
param(DocumentedParameter documentedParameter, Boolean isRepeatable, Function1<Parameter, Unit> applyUpdates)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter. final OpenApiDocumentation
param(DocumentedParameter documentedParameter, Boolean isRepeatable, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter. final OpenApiDocumentation
param(DocumentedParameter documentedParameter, Boolean isRepeatable)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter. final OpenApiDocumentation
param(DocumentedParameter documentedParameter)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter. final OpenApiDocumentation
formParam(String name, Class<?> clazz, Boolean required)
Documents that the handler can receive a form parameter. final OpenApiDocumentation
formParam(DocumentedFormParameter formParameter)
Documents that the handler can receive a form parameter detailed by the input DocumentedFormParameter. final OpenApiDocumentation
formParamBody(Class<?> clazz, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with a content type of application/x-www-form-urlencoded
in the form of clazz.final OpenApiDocumentation
formParamBody(Class<?> clazz)
Documents that the handler can receive a request body with a content type of application/x-www-form-urlencoded
in the form of clazz.final OpenApiDocumentation
formParamBody(Class<?> clazz, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with the input contentType in the form of clazz. final OpenApiDocumentation
uploadedFile(String name, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a file with the input name. final OpenApiDocumentation
uploadedFile(String name, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a file with the input name. final OpenApiDocumentation
uploadedFile(String name)
Documents that the handler can receive a file with the input name. final OpenApiDocumentation
uploadedFiles(String name, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive files with the input name. final OpenApiDocumentation
uploadedFiles(String name, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive files with the input name. final OpenApiDocumentation
uploadedFiles(String name)
Documents that the handler can receive files with the input name. final OpenApiDocumentation
body(Class<?> returnType, String contentType, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body in the form of returnType. final OpenApiDocumentation
body(Class<?> returnType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of returnType. final OpenApiDocumentation
body(Composition composition, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input composition. final OpenApiDocumentation
body(Composition composition, String contentType)
Documents that the handler can receive a request body in the form of the input composition. final OpenApiDocumentation
body(Composition composition)
Documents that the handler can receive a request body in the form of the input composition. final OpenApiDocumentation
body(Class<?> returnType, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of returnType. final OpenApiDocumentation
body(Class<?> returnType, String contentType)
Documents that the handler can receive a request body in the form of returnType. final OpenApiDocumentation
body(Class<?> returnType)
Documents that the handler can receive a request body in the form of returnType. final OpenApiDocumentation
body(Schema<?> schema, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input Schema. final OpenApiDocumentation
body(Schema<?> schema, String contentType)
Documents that the handler can receive a request body in the form of the input Schema. final OpenApiDocumentation
body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater, String contentType, ComposedType composedType)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater, String contentType)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
body(List<DocumentedContent> content)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
body(DocumentedRequestBody documentedBody, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
body(DocumentedRequestBody documentedBody)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody. final OpenApiDocumentation
bodyAsBytes(String contentType, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body with the input contentType in the form of bytes. final OpenApiDocumentation
bodyAsBytes(Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body with the input contentType in the form of bytes. final OpenApiDocumentation
bodyAsBytes(String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with the input contentType in the form of bytes. final OpenApiDocumentation
bodyAsBytes(String contentType)
Documents that the handler can receive a request body with the input contentType in the form of bytes. final OpenApiDocumentation
bodyAsBytes()
Documents that the handler can receive a request body with the input contentType in the form of bytes. final OpenApiDocumentation
jsonArray(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain application/json
representing an array of returnType.final OpenApiDocumentation
jsonArray(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain application/json
representing an array of returnType.final OpenApiDocumentation
json(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain application/json
in the form of returnType.final OpenApiDocumentation
json(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain application/json
in the form of returnType.final OpenApiDocumentation
html(String status, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input status code where the response body will contain text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.final OpenApiDocumentation
html(String status, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.final OpenApiDocumentation
html(String status)
Documents that the handler can return the input status code where the response body will contain text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.final OpenApiDocumentation
result(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain returnType. final OpenApiDocumentation
result(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain returnType. final OpenApiDocumentation
result(String status)
Documents that the handler can return the input status code where the response body will contain returnType. final OpenApiDocumentation
result(String status, Class<?> returnType, String contentType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain contentType in the form of returnType. final OpenApiDocumentation
result(String status, Class<?> returnType, String contentType)
Documents that the handler can return the input status code where the response body will contain contentType in the form of returnType. final OpenApiDocumentation
result(String status, Composition.OneOf composition, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input status code where the response body could contain different classes represented by Composition.OneOf. final OpenApiDocumentation
result(String status, Composition.OneOf composition)
Documents that the handler can return the input status code where the response body could contain different classes represented by Composition.OneOf. final OpenApiDocumentation
result(DocumentedResponse documentedResponse, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input DocumentedResponse. final OpenApiDocumentation
result(String status, DocumentedContent content, OpenApiUpdater<ApiResponse> updater)
Documents that the handler can return the input status code where the response body will contain the input DocumentedContent. final OpenApiDocumentation
result(String status, List<DocumentedContent> content, OpenApiUpdater<ApiResponse> updater)
Documents that the handler can return the input status code where the response body could contain the input DocumentedContents. final OpenApiDocumentation
result(DocumentedResponse documentedResponse, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input DocumentedResponse. final OpenApiDocumentation
result(DocumentedResponse documentedResponse)
Documents that the handler can return the input DocumentedResponse. final Unit
apply(OpenApiDocumentation other)
Merge the values of another documentation into this documentation -
-
Method Detail
-
getIsIgnored
final Boolean getIsIgnored()
-
setIsIgnored
final Unit setIsIgnored(Boolean isIgnored)
-
getOperationUpdaterList
final List<OpenApiUpdater<Operation>> getOperationUpdaterList()
-
getRequestBodyList
final List<OpenApiUpdater<RequestBody>> getRequestBodyList()
-
getParameterUpdaterListMapping
final Map<String, List<OpenApiUpdater<Parameter>>> getParameterUpdaterListMapping()
-
getResponseUpdaterListMapping
final Map<String, List<OpenApiUpdater<ApiResponse>>> getResponseUpdaterListMapping()
-
getComponentsUpdaterList
final List<OpenApiUpdater<Components>> getComponentsUpdaterList()
-
getFormParameterList
final List<DocumentedFormParameter> getFormParameterList()
-
getFileUploadList
final List<DocumentedFileUpload> getFileUploadList()
-
hasRequestBodies
final Boolean hasRequestBodies()
-
hasResponses
final Boolean hasResponses()
-
hasFormParameter
final Boolean hasFormParameter()
-
hasFileUploads
final Boolean hasFileUploads()
-
ignore
@JvmOverloads() final OpenApiDocumentation ignore(Boolean isIgnored)
Hide the endpoint in the documentation
-
ignore
@JvmOverloads() final OpenApiDocumentation ignore()
Hide the endpoint in the documentation
-
operation
final OpenApiDocumentation operation(Function1<Operation, Unit> applyUpdates)
Documents the handler using the Operation provided by the input applyUpdates.
- Parameters:
applyUpdates
- A function that returns a Swagger Operation.
-
operation
final OpenApiDocumentation operation(OpenApiUpdater<Operation> openApiUpdater)
Documents the handler using the Operation provided by the input openApiUpdater.
- Parameters:
openApiUpdater
- A function that returns a Swagger Operation.
-
pathParam
@JvmOverloads() final OpenApiDocumentation pathParam(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a path parameter.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.openApiUpdater
- A function that allows the underlying Swagger Parameter to modified directly.
-
pathParam
@JvmOverloads() final OpenApiDocumentation pathParam(String name, Class<?> clazz)
Documents that the handler can receive a path parameter.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.
-
queryParam
@JvmOverloads() final OpenApiDocumentation queryParam(String name, Class<?> clazz, Boolean isRepeatable, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a query parameter.
queryParam can be called multiple times with different names that represent different parameters, all will be added to the generated documentation.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.isRepeatable
- Whether the parameter is repeatable.openApiUpdater
- A function that allows the underlying Swagger Parameter to modified directly.
-
queryParam
@JvmOverloads() final OpenApiDocumentation queryParam(String name, Class<?> clazz, Boolean isRepeatable)
Documents that the handler can receive a query parameter.
queryParam can be called multiple times with different names that represent different parameters, all will be added to the generated documentation.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.isRepeatable
- Whether the parameter is repeatable.
-
queryParam
@JvmOverloads() final OpenApiDocumentation queryParam(String name, Class<?> clazz)
Documents that the handler can receive a query parameter.
queryParam can be called multiple times with different names that represent different parameters, all will be added to the generated documentation.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.
-
header
@JvmOverloads() final OpenApiDocumentation header(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler has a header.
header can be called multiple times with different names that represent different headers, all will be added to the generated documentation.
- Parameters:
name
- The name of the header.clazz
- The class that represents the header.openApiUpdater
- A function that allows the underlying Swagger Parameter to modified directly.
-
header
@JvmOverloads() final OpenApiDocumentation header(String name, Class<?> clazz)
Documents that the handler has a header.
header can be called multiple times with different names that represent different headers, all will be added to the generated documentation.
- Parameters:
name
- The name of the header.clazz
- The class that represents the header.
-
cookie
@JvmOverloads() final OpenApiDocumentation cookie(String name, Class<?> clazz, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a cookie.
cookie can be called multiple times with different names that represent different cookies, all will be added to the generated documentation.
- Parameters:
name
- The name of the cookie.clazz
- The class that represents the cookie.openApiUpdater
- A function that allows the underlying Swagger Parameter to modified directly.
-
cookie
@JvmOverloads() final OpenApiDocumentation cookie(String name, Class<?> clazz)
Documents that the handler can receive a cookie.
cookie can be called multiple times with different names that represent different cookies, all will be added to the generated documentation.
- Parameters:
name
- The name of the cookie.clazz
- The class that represents the cookie.
-
param
final OpenApiDocumentation param(DocumentedParameter documentedParameter, Boolean isRepeatable, Function1<Parameter, Unit> applyUpdates)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter.
param can be called multiple times with different DocumentedParameters that represent different parameters, all will be added to the generated documentation.
- Parameters:
documentedParameter
- The DocumentedParameter the handler can receive.isRepeatable
- Whether the parameter is repeatable.applyUpdates
- A function that allows the underlying Swagger Parameter to modified directly.
-
param
@JvmOverloads() final OpenApiDocumentation param(DocumentedParameter documentedParameter, Boolean isRepeatable, OpenApiUpdater<Parameter> openApiUpdater)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter.
param can be called multiple times with different DocumentedParameters that represent different parameters, all will be added to the generated documentation.
- Parameters:
documentedParameter
- The DocumentedParameter the handler can receive.isRepeatable
- Whether the parameter is repeatable.openApiUpdater
- A function that allows the underlying Swagger Parameter to modified directly.
-
param
@JvmOverloads() final OpenApiDocumentation param(DocumentedParameter documentedParameter, Boolean isRepeatable)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter.
param can be called multiple times with different DocumentedParameters that represent different parameters, all will be added to the generated documentation.
- Parameters:
documentedParameter
- The DocumentedParameter the handler can receive.isRepeatable
- Whether the parameter is repeatable.
-
param
@JvmOverloads() final OpenApiDocumentation param(DocumentedParameter documentedParameter)
Documents that the handler can receive a parameter detailed by the input DocumentedParameter.
param can be called multiple times with different DocumentedParameters that represent different parameters, all will be added to the generated documentation.
- Parameters:
documentedParameter
- The DocumentedParameter the handler can receive.
-
formParam
final OpenApiDocumentation formParam(String name, Class<?> clazz, Boolean required)
Documents that the handler can receive a form parameter.
formParam can be called multiple times with different names that represent different form parameters, all will be added to the generated documentation.
- Parameters:
name
- The name of the parameter.clazz
- The class of the parameter.required
- Whether the parameter is required.
-
formParam
final OpenApiDocumentation formParam(DocumentedFormParameter formParameter)
Documents that the handler can receive a form parameter detailed by the input DocumentedFormParameter.
formParam can be called multiple times with different DocumentedFormParameters that represent different form parameters, all will be added to the generated documentation.
- Parameters:
formParameter
- The DocumentedFormParameter the handler can receive.
-
formParamBody
@JvmOverloads() final OpenApiDocumentation formParamBody(Class<?> clazz, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with a content type of
application/x-www-form-urlencoded
in the form of clazz.- Parameters:
clazz
- The class that the handler can receive in its request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
formParamBody
@JvmOverloads() final OpenApiDocumentation formParamBody(Class<?> clazz)
Documents that the handler can receive a request body with a content type of
application/x-www-form-urlencoded
in the form of clazz.- Parameters:
clazz
- The class that the handler can receive in its request body.
-
formParamBody
final OpenApiDocumentation formParamBody(Class<?> clazz, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with the input contentType in the form of clazz.
If no contentType is provided then a content type of
application/x-www-form-urlencoded
is used.- Parameters:
clazz
- The class that the handler can receive in its request body.contentType
- The content type of the request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
uploadedFile
final OpenApiDocumentation uploadedFile(String name, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a file with the input name.
uploadedFile can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.applyUpdates
- A function that allows the underlying Swagger RequestBody to modified directly.
-
uploadedFile
@JvmOverloads() final OpenApiDocumentation uploadedFile(String name, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a file with the input name.
uploadedFile can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
uploadedFile
@JvmOverloads() final OpenApiDocumentation uploadedFile(String name)
Documents that the handler can receive a file with the input name.
uploadedFile can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.
-
uploadedFiles
final OpenApiDocumentation uploadedFiles(String name, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive files with the input name.
uploadedFiles can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.applyUpdates
- A function that allows the underlying Swagger RequestBody to modified directly.
-
uploadedFiles
@JvmOverloads() final OpenApiDocumentation uploadedFiles(String name, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive files with the input name.
uploadedFiles can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
uploadedFiles
@JvmOverloads() final OpenApiDocumentation uploadedFiles(String name)
Documents that the handler can receive files with the input name.
uploadedFiles can be called multiple times with different names that represent different files, all will be added to the generated documentation.
- Parameters:
name
- The name of the uploaded files.
-
body
final OpenApiDocumentation body(Class<?> returnType, String contentType, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body in the form of returnType.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
returnType
- The class that the handler can receive in its request body.contentType
- The content type of the request body.applyUpdates
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
final OpenApiDocumentation body(Class<?> returnType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of returnType.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
returnType
- The class that the handler can receive in its request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(Composition composition, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input composition.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
composition
- The Composition that the handler can receive in its request body.contentType
- The content type of the request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(Composition composition, String contentType)
Documents that the handler can receive a request body in the form of the input composition.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
composition
- The Composition that the handler can receive in its request body.contentType
- The content type of the request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(Composition composition)
Documents that the handler can receive a request body in the form of the input composition.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
composition
- The Composition that the handler can receive in its request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(Class<?> returnType, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of returnType.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
returnType
- The class that the handler can receive in its request body.contentType
- The content type of the request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(Class<?> returnType, String contentType)
Documents that the handler can receive a request body in the form of returnType.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
returnType
- The class that the handler can receive in its request body.contentType
- The content type of the request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(Class<?> returnType)
Documents that the handler can receive a request body in the form of returnType.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
returnType
- The class that the handler can receive in its request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(Schema<?> schema, String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input Schema.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
schema
- The Schema that the handler can receive in its request body.contentType
- The content type of the request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(Schema<?> schema, String contentType)
Documents that the handler can receive a request body in the form of the input Schema.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
schema
- The Schema that the handler can receive in its request body.contentType
- The content type of the request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater, String contentType, ComposedType composedType)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
content
- The DocumentedContents that the handler can receive in its request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.contentType
- The content type of the request body.composedType
- The ComposedType of the request body's content.
-
body
@JvmOverloads() final OpenApiDocumentation body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater, String contentType)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
content
- The DocumentedContents that the handler can receive in its request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.contentType
- The content type of the request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(List<DocumentedContent> content, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
content
- The DocumentedContents that the handler can receive in its request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(List<DocumentedContent> content)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
content
- The DocumentedContents that the handler can receive in its request body.
-
body
@JvmOverloads() final OpenApiDocumentation body(DocumentedRequestBody documentedBody, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
documentedBody
- The DocumentedRequestBody that the handler can receive.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
body
@JvmOverloads() final OpenApiDocumentation body(DocumentedRequestBody documentedBody)
Documents that the handler can receive a request body in the form of the input DocumentedRequestBody.
body can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
documentedBody
- The DocumentedRequestBody that the handler can receive.
-
bodyAsBytes
@JvmOverloads() final OpenApiDocumentation bodyAsBytes(String contentType, Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body with the input contentType in the form of bytes.
bodyAsBytes can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
contentType
- The content type of the request body.applyUpdates
- A function that allows the underlying Swagger RequestBody to modified directly.
-
bodyAsBytes
@JvmOverloads() final OpenApiDocumentation bodyAsBytes(Function1<RequestBody, Unit> applyUpdates)
Documents that the handler can receive a request body with the input contentType in the form of bytes.
bodyAsBytes can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
applyUpdates
- A function that allows the underlying Swagger RequestBody to modified directly.
-
bodyAsBytes
@JvmOverloads() final OpenApiDocumentation bodyAsBytes(String contentType, OpenApiUpdater<RequestBody> openApiUpdater)
Documents that the handler can receive a request body with the input contentType in the form of bytes.
bodyAsBytes can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
contentType
- The content type of the request body.openApiUpdater
- A function that allows the underlying Swagger RequestBody to modified directly.
-
bodyAsBytes
@JvmOverloads() final OpenApiDocumentation bodyAsBytes(String contentType)
Documents that the handler can receive a request body with the input contentType in the form of bytes.
bodyAsBytes can be called multiple times that represent different request bodies, all will be added to the generated documentation.
- Parameters:
contentType
- The content type of the request body.
-
bodyAsBytes
@JvmOverloads() final OpenApiDocumentation bodyAsBytes()
Documents that the handler can receive a request body with the input contentType in the form of bytes.
bodyAsBytes can be called multiple times that represent different request bodies, all will be added to the generated documentation.
-
jsonArray
@JvmOverloads() final OpenApiDocumentation jsonArray(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain
application/json
representing an array of returnType.A schema will be added to represent class T in the documentation.
jsonArray can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
jsonArray
@JvmOverloads() final OpenApiDocumentation jsonArray(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain
application/json
representing an array of returnType.A schema will be added to represent class T in the documentation.
jsonArray can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.
-
json
@JvmOverloads() final OpenApiDocumentation json(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain
application/json
in the form of returnType.A schema will be added to represent class returnType in the documentation.
json can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
json
@JvmOverloads() final OpenApiDocumentation json(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain
application/json
in the form of returnType.A schema will be added to represent class returnType in the documentation.
json can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.
-
html
final OpenApiDocumentation html(String status, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input status code where the response body will contain
text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.applyUpdates
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
html
@JvmOverloads() final OpenApiDocumentation html(String status, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain
text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
html
@JvmOverloads() final OpenApiDocumentation html(String status)
Documents that the handler can return the input status code where the response body will contain
text/html
html can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Class<?> returnType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain returnType.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Class<?> returnType)
Documents that the handler can return the input status code where the response body will contain returnType.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status)
Documents that the handler can return the input status code where the response body will contain returnType.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Class<?> returnType, String contentType, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input status code where the response body will contain contentType in the form of returnType.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Class<?> returnType, String contentType)
Documents that the handler can return the input status code where the response body will contain contentType in the form of returnType.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.returnType
- The class that the documented response body contains.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Composition.OneOf composition, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input status code where the response body could contain different classes represented by Composition.OneOf.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.composition
- The classes that could be contained in the documented response body.applyUpdates
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
@JvmOverloads() final OpenApiDocumentation result(String status, Composition.OneOf composition)
Documents that the handler can return the input status code where the response body could contain different classes represented by Composition.OneOf.
result can be called multiple times with different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.composition
- The classes that could be contained in the documented response body.
-
result
final OpenApiDocumentation result(DocumentedResponse documentedResponse, Function1<ApiResponse, Unit> applyUpdates)
Documents that the handler can return the input DocumentedResponse.
result can be called multiple times with different DocumentedResponses that represent different status codes, all will be added to the generated documentation.
- Parameters:
documentedResponse
- The DocumentedResponse to use.applyUpdates
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
final OpenApiDocumentation result(String status, DocumentedContent content, OpenApiUpdater<ApiResponse> updater)
Documents that the handler can return the input status code where the response body will contain the input DocumentedContent.
result can be called multiple times with different DocumentedResponses that represent different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.content
- The DocumentedContent that the documented response body contains.updater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
final OpenApiDocumentation result(String status, List<DocumentedContent> content, OpenApiUpdater<ApiResponse> updater)
Documents that the handler can return the input status code where the response body could contain the input DocumentedContents.
result can be called multiple times with different DocumentedResponses that represent different status codes, all will be added to the generated documentation.
- Parameters:
status
- The status code to document.content
- The DocumentedContents that the documented response body could contain.updater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
@JvmOverloads() final OpenApiDocumentation result(DocumentedResponse documentedResponse, OpenApiUpdater<ApiResponse> openApiUpdater)
Documents that the handler can return the input DocumentedResponse.
result can be called multiple times with different DocumentedResponses that represent different status codes, all will be added to the generated documentation.
- Parameters:
documentedResponse
- The DocumentedResponse to use.openApiUpdater
- A function that allows the underlying Swagger ApiResponse to modified directly.
-
result
@JvmOverloads() final OpenApiDocumentation result(DocumentedResponse documentedResponse)
Documents that the handler can return the input DocumentedResponse.
result can be called multiple times with different DocumentedResponses that represent different status codes, all will be added to the generated documentation.
- Parameters:
documentedResponse
- The DocumentedResponse to use.
-
apply
final Unit apply(OpenApiDocumentation other)
Merge the values of another documentation into this documentation
-
-
-
-