Top Description Methods
org.eclipse.microprofile.openapi.models

public Interface Components

extends Constructible, Extensible<Components>
Imports
java.util.Map, org.eclipse.microprofile.openapi.models.callbacks.Callback, org.eclipse.microprofile.openapi.models.examples.Example, 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

Components

Holds a set of reusable objects for different aspects of the API specification. All objects defined within this object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

All the fields are indexed by keys that must match the regular expression: ^[a-zA-Z0-9\.\-_]+$.

Key Examples:

See Also
OpenAPI Specification Components Object

Method Summary

Modifier and TypeMethod and Description
public Components

Returns:

the current Components object
addCallback
(String
a key conforming to the format required for this object
key
,
Callback
a reusable callback object. null values will be rejected (implementation will throw an exception) or ignored.
callback
)

Adds the given callback to this Components' map of callbacks with the given string as its key.

public Components

Returns:

the current Components object
addExample
(String
a key conforming to the format required for this object
key
,
Example
a reusable example object. null values will be rejected (implementation will throw an exception) or ignored.
example
)

Adds the given example to this Components' map of examples with the given string as its key.

public Components

Returns:

the current Components object
addHeader
(String
a key conforming to the format required for this object
key
,
Header
a reusable header object. null values will be rejected (implementation will throw an exception) or ignored.
header
)

Adds the given header to this Components' map of headers with the given string as its key.

public Components

Returns:

the current Components object
addParameter
(String
a key conforming to the format required for this object
key
,
Parameter
a reusable parameter object. null values will be rejected (implementation will throw an exception) or ignored.
parameter
)

Adds the given parameter to this Components' map of parameters with the given string as its key.

public Components

Returns:

the current Schema instance
addPathItem
(String
name of the path item to add
name
,
PathItem
the path item to add
pathItem
)

Adds a path item.

public Components

Returns:

the current Components object
addRequestBody
(String
a key conforming to the format required for this object
key
,
RequestBody
a reusable request body object. null values will be rejected (implementation will throw an exception) or ignored.
requestBody
)

Adds the given request body to this Components' map of request bodies with the given string as its key.

public Components

Returns:

the current Components object
addResponse
(String
a key conforming to the format required for this object
key
,
APIResponse
a reusable response object. null values will be rejected (implementation will throw an exception) or ignored.
response
)

Adds the given response to this Components' map of responses with the given string as its key.

public Components

Returns:

the current Components object
addSchema
(String
a key conforming to the format required for this object
key
,
Schema
a reusable schema object. null values will be rejected (implementation will throw an exception) or ignored.
schema
)

Adds the given schema to this Components' list of schemas with the given string as its key.

public Components

Returns:

the current Components object
addSecurityScheme
(String
a key conforming to the format required for this object
key
,
SecurityScheme
a reusable security scheme object. null values will be rejected (implementation will throw an exception) or ignored.
securityScheme
)

Adds the given security scheme to this Components' map of security schemes with the given string as its key.

public default Components

Returns:

the current Components object
callbacks
(Map<String, Callback>
a Map containing the keys and reusable callback objects
callbacks
)

Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.

public default Components

Returns:

the current Components object
examples
(Map<String, Example>
a Map containing keys and reusable example objects
examples
)

Sets this Components' examples property to the given Map containing keys and reusable example objects.

public Map<String, Callback>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable callbacks for this OpenAPI document
getCallbacks
()

Returns the callbacks property from a Components instance.

public Map<String, Example>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable examples for this OpenAPI document
getExamples
()

Returns the examples property from a Components instance.

public Map<String, Header>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable headers for this OpenAPI document
getHeaders
()

Returns the headers property from a Components instance.

public Map<String, Parameter>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable parameters of API operations for this OpenAPI document
getParameters
()

Returns the parameters property from a Components instance.

public Map<String, PathItem>

Returns:

a copy Map (potentially immutable) of path items
getPathItems
()

Returns the pathItems property of this Components instance.

public Map<String, RequestBody>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable request bodies for this OpenAPI document
getRequestBodies
()

Returns the requestBodies property from a Components instance.

public Map<String, APIResponse>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable responses from API operations for this OpenAPI document
getResponses
()

Returns the responses property from a Components instance.

public Map<String, Schema>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable schemas for this OpenAPI document
getSchemas
()

Returns the schemas property from a Components instance.

public Map<String, SecurityScheme>

Returns:

a copy Map (potentially immutable) containing the keys and the reusable security schemes for this OpenAPI document
getSecuritySchemes
()

Returns the securitySchemes property from a Components instance.

public default Components

Returns:

the current Components object
headers
(Map<String, Header>
a Map containing the keys and reusable header objects
headers
)

Sets this Components' headers property to the given Map containing keys and reusable header objects.

public default Components

Returns:

the current Components object
parameters
(Map<String, Parameter>
a Map containing keys and reusable parameter objects
parameters
)

Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.

public default Components

Returns:

the current Schema instance
pathItems
(Map<String, PathItem>
a map of path items
pathItems
)

Sets the pathItems property of this Components instance.

public void
removeCallback(String
a key conforming to the format required for this object
key
)

Removes the given callback to this Components' map of callbacks with the given string as its key.

public void
removeExample(String
a key conforming to the format required for this object
key
)

Removes the given example to this Components' map of examples with the given string as its key.

public void
removeHeader(String
a key conforming to the format required for this object
key
)

Removes the given header to this Components' map of headers with the given string as its key.

public void
removeParameter(String
a key conforming to the format required for this object
key
)

Removes the given parameter to this Components' map of parameters with the given string as its key.

public void
removePathItem(String
name of the path item to remove
name
)

Removes a path item.

public void
removeRequestBody(String
a key conforming to the format required for this object
key
)

Removes the given request body to this Components' map of request bodies with the given string as its key.

public void
removeResponse(String
a key conforming to the format required for this object
key
)

Removes the given response to this Components' map of responses with the given string as its key.

public void
removeSchema(String
a key conforming to the format required for this object
key
)

Removes the given schema to this Components' list of schemas with the given string as its key.

public void
removeSecurityScheme(String
a key conforming to the format required for this object
key
)

Removes the given security scheme to this Components' map of security schemes with the given string as its key.

public default Components

Returns:

the current Components object
requestBodies
(Map<String, RequestBody>
a Map containing the keys and reusable request body objects
requestBodies
)

Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.

public default Components

Returns:

the current Components object
responses
(Map<String, APIResponse>
a Map containing keys and reusable response objects
responses
)

Sets this Components' responses property to the given Map containing keys and reusable response objects.

public default Components

Returns:

the current Components object
schemas
(Map<String, Schema>
a Map containing keys and reusable schemas
schemas
)

Sets this Components' schemas property to the given Map containing keys and reusable schemas.

public default Components

Returns:

the current Components object
securitySchemes
(Map<String, SecurityScheme>
a Map containing the keys and reusable security scheme objects
securitySchemes
)

Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.

public void
setCallbacks(Map<String, Callback>
a Map containing the keys and reusable callback objects
callbacks
)

Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.

public void
setExamples(Map<String, Example>
a Map containing keys and reusable example objects
examples
)

Sets this Components' examples property to the given Map containing keys and reusable example objects.

public void
setHeaders(Map<String, Header>
a Map containing the keys and reusable header objects
headers
)

Sets this Components' headers property to the given Map containing keys and reusable header objects.

public void
setParameters(Map<String, Parameter>
a Map containing keys and reusable parameter objects
parameters
)

Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.

public void
setPathItems(Map<String, PathItem>
a map of path items
pathItems
)

Sets the pathItems property of this Components instance.

public void
setRequestBodies(Map<String, RequestBody>
a Map containing the keys and reusable request body objects
requestBodies
)

Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.

public void
setResponses(Map<String, APIResponse>
a Map containing keys and reusable response objects
responses
)

Sets this Components' responses property to the given Map containing keys and reusable response objects.

public void
setSchemas(Map<String, Schema>
a Map containing keys and reusable schema objects
schemas
)

Sets this Components' schemas property to the given Map containing keys and reusable schema objects.

public void
setSecuritySchemes(Map<String, SecurityScheme>
a Map containing the keys and reusable security scheme objects
securitySchemes
)

Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.

Inherited from org.eclipse.microprofile.openapi.models.Extensible:
addExtensionextensionsgetExtensionsremoveExtensionsetExtensions

Method Detail

addCallbackback to summary
public Components addCallback(String key, Callback callback)

Adds the given callback to this Components' map of callbacks with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

callback:Callback

a reusable callback object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addExampleback to summary
public Components addExample(String key, Example example)

Adds the given example to this Components' map of examples with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

example:Example

a reusable example object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addHeaderback to summary
public Components addHeader(String key, Header header)

Adds the given header to this Components' map of headers with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

header:Header

a reusable header object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addParameterback to summary
public Components addParameter(String key, Parameter parameter)

Adds the given parameter to this Components' map of parameters with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

parameter:Parameter

a reusable parameter object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addPathItemback to summary
public Components addPathItem(String name, PathItem pathItem)

Adds a path item.

Parameters
name:String

name of the path item to add

pathItem:PathItem

the path item to add

Returns:Components

the current Schema instance

addRequestBodyback to summary
public Components addRequestBody(String key, RequestBody requestBody)

Adds the given request body to this Components' map of request bodies with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

requestBody:RequestBody

a reusable request body object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addResponseback to summary
public Components addResponse(String key, APIResponse response)

Adds the given response to this Components' map of responses with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

response:APIResponse

a reusable response object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addSchemaback to summary
public Components addSchema(String key, Schema schema)

Adds the given schema to this Components' list of schemas with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

schema:Schema

a reusable schema object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

addSecuritySchemeback to summary
public Components addSecurityScheme(String key, SecurityScheme securityScheme)

Adds the given security scheme to this Components' map of security schemes with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

securityScheme:SecurityScheme

a reusable security scheme object. null values will be rejected (implementation will throw an exception) or ignored.

Returns:Components

the current Components object

callbacksback to summary
public default Components callbacks(Map<String, Callback> callbacks)

Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.

Parameters
callbacks:Map<String, Callback>

a Map containing the keys and reusable callback objects

Returns:Components

the current Components object

examplesback to summary
public default Components examples(Map<String, Example> examples)

Sets this Components' examples property to the given Map containing keys and reusable example objects.

Parameters
examples:Map<String, Example>

a Map containing keys and reusable example objects

Returns:Components

the current Components object

getCallbacksback to summary
public Map<String, Callback> getCallbacks()

Returns the callbacks property from a Components instance.

Returns:Map<String, Callback>

a copy Map (potentially immutable) containing the keys and the reusable callbacks for this OpenAPI document

getExamplesback to summary
public Map<String, Example> getExamples()

Returns the examples property from a Components instance.

Returns:Map<String, Example>

a copy Map (potentially immutable) containing the keys and the reusable examples for this OpenAPI document

getHeadersback to summary
public Map<String, Header> getHeaders()

Returns the headers property from a Components instance.

Returns:Map<String, Header>

a copy Map (potentially immutable) containing the keys and the reusable headers for this OpenAPI document

getParametersback to summary
public Map<String, Parameter> getParameters()

Returns the parameters property from a Components instance.

Returns:Map<String, Parameter>

a copy Map (potentially immutable) containing the keys and the reusable parameters of API operations for this OpenAPI document

getPathItemsback to summary
public Map<String, PathItem> getPathItems()

Returns the pathItems property of this Components instance. Path items listed here can be referenced from elsewhere in the OpenAPI document.

Returns:Map<String, PathItem>

a copy Map (potentially immutable) of path items

Since
4.0
getRequestBodiesback to summary
public Map<String, RequestBody> getRequestBodies()

Returns the requestBodies property from a Components instance.

Returns:Map<String, RequestBody>

a copy Map (potentially immutable) containing the keys and the reusable request bodies for this OpenAPI document

getResponsesback to summary
public Map<String, APIResponse> getResponses()

Returns the responses property from a Components instance.

Returns:Map<String, APIResponse>

a copy Map (potentially immutable) containing the keys and the reusable responses from API operations for this OpenAPI document

getSchemasback to summary
public Map<String, Schema> getSchemas()

Returns the schemas property from a Components instance.

Returns:Map<String, Schema>

a copy Map (potentially immutable) containing the keys and the reusable schemas for this OpenAPI document

getSecuritySchemesback to summary
public Map<String, SecurityScheme> getSecuritySchemes()

Returns the securitySchemes property from a Components instance.

Returns:Map<String, SecurityScheme>

a copy Map (potentially immutable) containing the keys and the reusable security schemes for this OpenAPI document

headersback to summary
public default Components headers(Map<String, Header> headers)

Sets this Components' headers property to the given Map containing keys and reusable header objects.

Parameters
headers:Map<String, Header>

a Map containing the keys and reusable header objects

Returns:Components

the current Components object

parametersback to summary
public default Components parameters(Map<String, Parameter> parameters)

Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.

Parameters
parameters:Map<String, Parameter>

a Map containing keys and reusable parameter objects

Returns:Components

the current Components object

pathItemsback to summary
public default Components pathItems(Map<String, PathItem> pathItems)

Sets the pathItems property of this Components instance. Path items listed here can be referenced from elsewhere in the OpenAPI document.

Parameters
pathItems:Map<String, PathItem>

a map of path items

Returns:Components

the current Schema instance

Since
4.0
removeCallbackback to summary
public void removeCallback(String key)

Removes the given callback to this Components' map of callbacks with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeExampleback to summary
public void removeExample(String key)

Removes the given example to this Components' map of examples with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeHeaderback to summary
public void removeHeader(String key)

Removes the given header to this Components' map of headers with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeParameterback to summary
public void removeParameter(String key)

Removes the given parameter to this Components' map of parameters with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removePathItemback to summary
public void removePathItem(String name)

Removes a path item.

Parameters
name:String

name of the path item to remove

removeRequestBodyback to summary
public void removeRequestBody(String key)

Removes the given request body to this Components' map of request bodies with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeResponseback to summary
public void removeResponse(String key)

Removes the given response to this Components' map of responses with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeSchemaback to summary
public void removeSchema(String key)

Removes the given schema to this Components' list of schemas with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

removeSecuritySchemeback to summary
public void removeSecurityScheme(String key)

Removes the given security scheme to this Components' map of security schemes with the given string as its key.

Parameters
key:String

a key conforming to the format required for this object

requestBodiesback to summary
public default Components requestBodies(Map<String, RequestBody> requestBodies)

Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.

Parameters
requestBodies:Map<String, RequestBody>

a Map containing the keys and reusable request body objects

Returns:Components

the current Components object

responsesback to summary
public default Components responses(Map<String, APIResponse> responses)

Sets this Components' responses property to the given Map containing keys and reusable response objects.

Parameters
responses:Map<String, APIResponse>

a Map containing keys and reusable response objects

Returns:Components

the current Components object

schemasback to summary
public default Components schemas(Map<String, Schema> schemas)

Sets this Components' schemas property to the given Map containing keys and reusable schemas.

Parameters
schemas:Map<String, Schema>

a Map containing keys and reusable schemas

Returns:Components

the current Components object

securitySchemesback to summary
public default Components securitySchemes(Map<String, SecurityScheme> securitySchemes)

Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.

Parameters
securitySchemes:Map<String, SecurityScheme>

a Map containing the keys and reusable security scheme objects

Returns:Components

the current Components object

setCallbacksback to summary
public void setCallbacks(Map<String, Callback> callbacks)

Sets this Components' callbacks property to the given Map containing keys and reusable callback objects.

Parameters
callbacks:Map<String, Callback>

a Map containing the keys and reusable callback objects

setExamplesback to summary
public void setExamples(Map<String, Example> examples)

Sets this Components' examples property to the given Map containing keys and reusable example objects.

Parameters
examples:Map<String, Example>

a Map containing keys and reusable example objects

setHeadersback to summary
public void setHeaders(Map<String, Header> headers)

Sets this Components' headers property to the given Map containing keys and reusable header objects.

Parameters
headers:Map<String, Header>

a Map containing the keys and reusable header objects

setParametersback to summary
public void setParameters(Map<String, Parameter> parameters)

Sets this Components' parameters property to the given Map containing keys and reusable parameter objects.

Parameters
parameters:Map<String, Parameter>

a Map containing keys and reusable parameter objects

setPathItemsback to summary
public void setPathItems(Map<String, PathItem> pathItems)

Sets the pathItems property of this Components instance. Path items listed here can be referenced from elsewhere in the OpenAPI document.

Parameters
pathItems:Map<String, PathItem>

a map of path items

Since
4.0
setRequestBodiesback to summary
public void setRequestBodies(Map<String, RequestBody> requestBodies)

Sets this Components' requestBodies property to the given Map containing keys and reusable request body objects.

Parameters
requestBodies:Map<String, RequestBody>

a Map containing the keys and reusable request body objects

setResponsesback to summary
public void setResponses(Map<String, APIResponse> responses)

Sets this Components' responses property to the given Map containing keys and reusable response objects.

Parameters
responses:Map<String, APIResponse>

a Map containing keys and reusable response objects

setSchemasback to summary
public void setSchemas(Map<String, Schema> schemas)

Sets this Components' schemas property to the given Map containing keys and reusable schema objects.

Parameters
schemas:Map<String, Schema>

a Map containing keys and reusable schema objects

setSecuritySchemesback to summary
public void setSecuritySchemes(Map<String, SecurityScheme> securitySchemes)

Sets this Components' securitySchemes property to the given Map containing keys and reusable security scheme objects.

Parameters
securitySchemes:Map<String, SecurityScheme>

a Map containing the keys and reusable security scheme objects