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

public Interface APIResponse

extends Constructible, Extensible<APIResponse>, Reference<APIResponse>
Imports
java.util.Map, org.eclipse.microprofile.openapi.models.Constructible, .Extensible, .Reference, org.eclipse.microprofile.openapi.models.headers.Header, org.eclipse.microprofile.openapi.models.links.Link, org.eclipse.microprofile.openapi.models.media.Content

This interface represents a single response from an API Operation, including design-time, static links to operations based on the response.
See Also
OpenAPI Specification Response Object

Method Summary

Modifier and TypeMethod and Description
public APIResponse

Returns:

this ApiResponse instance
addHeader
(String
the unique name of the header
name
,
Header
a header for the response. null values will be rejected (implementation will throw an exception) or ignored.
header
)

Adds the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse.

public default APIResponse

Returns:

this ApiResponse instance
content
(Content
the potential content of the response
content
)

Sets the map containing descriptions of potential response payload for this instance of ApiResponse and returns this ApiResponse instance.

public default APIResponse

Returns:

this ApiResponse instance
description
(String
a short description of the response
description
)

Sets the description of this instance of ApiResponse and returns this ApiResponse instance.

public Content

Returns:

the potential content of the response
getContent
()

Returns the map containing descriptions of potential response payload for this instance of ApiResponse.

public String

Returns:

a short description of the response
getDescription
()

Returns a short description of this instance of ApiResponse.

public Map<String, Header>

Returns:

a copy Map (potentially immutable) of the headers of this response
getHeaders
()

Returns the map of Headers in this instance of ApiResponse.

public default APIResponse

Returns:

this ApiResponse instance
headers
(Map<String, Header>
the headers of the response
headers
)

Sets the Headers for this instance of ApiResponse with the given map of Headers and returns this instance of ApiResponse.

public void
removeHeader(String
the unique name of the header
name
)

Removes the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse.

public void
setContent(Content
the potential content of the response
content
)

Sets the map containing descriptions of potential response payload for this instance of ApiResponse.

public void
setDescription(String
a short description of the response
description
)

Sets the description of this instance of ApiResponse.

public void
setHeaders(Map<String, Header>
the headers of the response
headers
)

Sets the Headers for this instance of ApiResponse with the given map of Headers.

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

Method Detail

addHeaderback to summary
public APIResponse addHeader(String name, Header header)

Adds the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse. If this ApiResponse instance does not have any headers, a new map is created and the given header is added.

Parameters
name:String

the unique name of the header

header:Header

a header for the response. null values will be rejected (implementation will throw an exception) or ignored.

Returns:APIResponse

this ApiResponse instance

contentback to summary
public default APIResponse content(Content content)

Sets the map containing descriptions of potential response payload for this instance of ApiResponse and returns this ApiResponse instance.

Parameters
content:Content

the potential content of the response

Returns:APIResponse

this ApiResponse instance

descriptionback to summary
public default APIResponse description(String description)

Sets the description of this instance of ApiResponse and returns this ApiResponse instance.

Parameters
description:String

a short description of the response

Returns:APIResponse

this ApiResponse instance

getContentback to summary
public Content getContent()

Returns the map containing descriptions of potential response payload for this instance of ApiResponse.

Returns:Content

the potential content of the response

getDescriptionback to summary
public String getDescription()

Returns a short description of this instance of ApiResponse.

Returns:String

a short description of the response

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

Returns the map of Headers in this instance of ApiResponse.

Returns:Map<String, Header>

a copy Map (potentially immutable) of the headers of this response

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

Sets the Headers for this instance of ApiResponse with the given map of Headers and returns this instance of ApiResponse. The Header names are case insensitive and if a Header is defined with the name 'Content-Type', then it will be ignored.

Parameters
headers:Map<String, Header>

the headers of the response

Returns:APIResponse

this ApiResponse instance

removeHeaderback to summary
public void removeHeader(String name)

Removes the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse. If this ApiResponse instance does not have any headers, a new map is created and the given header is added.

Parameters
name:String

the unique name of the header

setContentback to summary
public void setContent(Content content)

Sets the map containing descriptions of potential response payload for this instance of ApiResponse.

Parameters
content:Content

the potential content of the response

setDescriptionback to summary
public void setDescription(String description)

Sets the description of this instance of ApiResponse.

Parameters
description:String

a short description of the response

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

Sets the Headers for this instance of ApiResponse with the given map of Headers. The Header names are case insensitive and if a Header is defined with the name 'Content-Type', then it will be ignored.

Parameters
headers:Map<String, Header>

the headers of the response