Top Description Methods
org.eclipse.microprofile.openapi

public Interface OASFilter

Imports
org.eclipse.microprofile.openapi.models.OpenAPI, .Operation, .PathItem, org.eclipse.microprofile.openapi.models.callbacks.Callback, org.eclipse.microprofile.openapi.models.headers.Header, org.eclipse.microprofile.openapi.models.links.Link, org.eclipse.microprofile.openapi.models.media.Schema, org.eclipse.microprofile.openapi.models.parameters.Parameter, .RequestBody, org.eclipse.microprofile.openapi.models.responses.APIResponse, org.eclipse.microprofile.openapi.models.security.SecurityScheme, org.eclipse.microprofile.openapi.models.servers.Server, org.eclipse.microprofile.openapi.models.tags.Tag

This interface allows application developers to filter different parts of the OpenAPI model tree. A common scenario is to dynamically augment (update or remove) OpenAPI elements based on the environment that the application is currently in. The registration of this filter is controlled by setting the key mp.openapi.filter using one of the configuration sources specified in MicroProfile Config. The value is the fully qualified name of the filter implementation, which needs to be visible to the application's classloader.

Method Summary

Modifier and TypeMethod and Description
public default APIResponse

Returns:

the APIResponse to be used or null
filterAPIResponse
(APIResponse
the current APIResponse element
apiResponse
)

Allows filtering of a particular APIResponse.

public default Callback

Returns:

the Callback to be used or null
filterCallback
(Callback
the current Callback element
callback
)

Allows filtering of a particular Callback.

public default Header

Returns:

the Header to be used or null
filterHeader
(Header
the current Header element
header
)

Allows filtering of a particular Header.

public default void
filterOpenAPI(OpenAPI
the current OpenAPI element
openAPI
)

Allows filtering of the singleton OpenAPI element.

public default Operation

Returns:

the Operation to be used or null
filterOperation
(Operation
the current Operation element
operation
)

Allows filtering of a particular Operation.

public default Parameter

Returns:

the Parameter to be used or null
filterParameter
(Parameter
the current Parameter element
parameter
)

Allows filtering of a particular Parameter.

public default PathItem

Returns:

the PathItem to be used or null
filterPathItem
(PathItem
the current PathItem element
pathItem
)

Allows filtering of a particular PathItem.

public default RequestBody

Returns:

the RequestBody to be used or null
filterRequestBody
(RequestBody
the current RequestBody element
requestBody
)

Allows filtering of a particular RequestBody.

public default Schema

Returns:

the Schema to be used or null
filterSchema
(Schema
the current Schema element
schema
)

Allows filtering of a particular Schema.

public default SecurityScheme

Returns:

the SecurityScheme to be used or null
filterSecurityScheme
(SecurityScheme
the current SecurityScheme element
securityScheme
)

Allows filtering of a particular SecurityScheme.

public default Server

Returns:

the Server to be used or null
filterServer
(Server
the current Server element
server
)

Allows filtering of a particular Server.

public default Tag

Returns:

the Tag to be used or null
filterTag
(Tag
the current Tag element
tag
)

Allows filtering of a particular Tag.

Method Detail

filterAPIResponseback to summary
public default APIResponse filterAPIResponse(APIResponse apiResponse)

Allows filtering of a particular APIResponse. Implementers of this method can choose to update the given APIResponse, pass it back as-is, or return null if removing this APIResponse.

Parameters
apiResponse:APIResponse

the current APIResponse element

Returns:APIResponse

the APIResponse to be used or null

filterCallbackback to summary
public default Callback filterCallback(Callback callback)

Allows filtering of a particular Callback. Implementers of this method can choose to update the given Callback, pass it back as-is, or return null if removing this Callback.

Parameters
callback:Callback

the current Callback element

Returns:Callback

the Callback to be used or null

filterHeaderback to summary
public default Header filterHeader(Header header)

Allows filtering of a particular Header. Implementers of this method can choose to update the given Header, pass it back as-is, or return null if removing this Header.

Parameters
header:Header

the current Header element

Returns:Header

the Header to be used or null

filterOpenAPIback to summary
public default void filterOpenAPI(OpenAPI openAPI)

Allows filtering of the singleton OpenAPI element. Implementers of this method can choose to update this element, or do nothing if no change is required. Note that one cannot remove this element from the model tree, hence the return type of void. This is the last method called for a given filter, therefore it symbolizes the end of processing by the vendor framework.

Parameters
openAPI:OpenAPI

the current OpenAPI element

filterOperationback to summary
public default Operation filterOperation(Operation operation)

Allows filtering of a particular Operation. Implementers of this method can choose to update the given Operation, pass it back as-is, or return null if removing this Operation.

Parameters
operation:Operation

the current Operation element

Returns:Operation

the Operation to be used or null

filterParameterback to summary
public default Parameter filterParameter(Parameter parameter)

Allows filtering of a particular Parameter. Implementers of this method can choose to update the given Parameter, pass it back as-is, or return null if removing this Parameter.

Parameters
parameter:Parameter

the current Parameter element

Returns:Parameter

the Parameter to be used or null

filterPathItemback to summary
public default PathItem filterPathItem(PathItem pathItem)

Allows filtering of a particular PathItem. Implementers of this method can choose to update the given PathItem, pass it back as-is, or return null if removing this PathItem.

Parameters
pathItem:PathItem

the current PathItem element

Returns:PathItem

the PathItem to be used or null

filterRequestBodyback to summary
public default RequestBody filterRequestBody(RequestBody requestBody)

Allows filtering of a particular RequestBody. Implementers of this method can choose to update the given RequestBody, pass it back as-is, or return null if removing this RequestBody.

Parameters
requestBody:RequestBody

the current RequestBody element

Returns:RequestBody

the RequestBody to be used or null

filterSchemaback to summary
public default Schema filterSchema(Schema schema)

Allows filtering of a particular Schema. Implementers of this method can choose to update the given Schema, pass it back as-is, or return null if removing this Schema.

Parameters
schema:Schema

the current Schema element

Returns:Schema

the Schema to be used or null

filterSecuritySchemeback to summary
public default SecurityScheme filterSecurityScheme(SecurityScheme securityScheme)

Allows filtering of a particular SecurityScheme. Implementers of this method can choose to update the given SecurityScheme, pass it back as-is, or return null if removing this SecurityScheme.

Parameters
securityScheme:SecurityScheme

the current SecurityScheme element

Returns:SecurityScheme

the SecurityScheme to be used or null

filterServerback to summary
public default Server filterServer(Server server)

Allows filtering of a particular Server. Implementers of this method can choose to update the given Server, pass it back as-is, or return null if removing this Server.

Parameters
server:Server

the current Server element

Returns:Server

the Server to be used or null

filterTagback to summary
public default Tag filterTag(Tag tag)

Allows filtering of a particular Tag. Implementers of this method can choose to update the given Tag, pass it back as-is, or return null if removing this Tag.

Parameters
tag:Tag

the current Tag element

Returns:Tag

the Tag to be used or null