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

public Interface OpenAPI

extends Constructible, Extensible<OpenAPI>
Imports
java.util.List, .Map, org.eclipse.microprofile.openapi.models.info.Info, org.eclipse.microprofile.openapi.models.security.SecurityRequirement, org.eclipse.microprofile.openapi.models.servers.Server, org.eclipse.microprofile.openapi.models.tags.Tag

OpenAPI

This is the root document object of the OpenAPI document. It contains required and optional fields.

See Also
OpenAPI Specification OpenAPI Object

Method Summary

Modifier and TypeMethod and Description
public OpenAPI

Returns:

the current OpenAPI object
addSecurityRequirement
(SecurityRequirement
security mechanism which can be used across the API
securityRequirement
)

Adds the given security requirement to this OpenAPI instance's list of security requirements.

public OpenAPI

Returns:

the current OpenAPI object
addServer
(Server
Server object which provides connectivity information to a target server
server
)

Adds the given server to this OpenAPI instance's list of servers.

public OpenAPI

Returns:

the current OpenAPI object
addTag
(Tag
a tag used by the specification with additional metadata
tag
)

Adds the given tag to this OpenAPI instance's list of tags.

public OpenAPI

Returns:

the current Schema instance
addWebhook
(String
unique name of the webhook to add
name
,
PathItem
webhook definition to add
webhook
)

Adds a webhook definition.

public default OpenAPI

Returns:

the current OpenAPI object
components
(Components
a set of reusable objects used in the API specification
components
)

Sets this OpenAPI instance's components property to the given components.

public default OpenAPI

Returns:

the current OpenAPI object
externalDocs
(ExternalDocumentation
additional external documentation
externalDocs
)

Sets this OpenAPI instance's externalDocs property to the given object.

public Components

Returns:

schemas used in the specification
getComponents
()

Returns the components property from an OpenAPI instance.

public ExternalDocumentation

Returns:

additional external documentation
getExternalDocs
()

Returns the externalDocs property from an OpenAPI instance.

public Info

Returns:

metadata about the API
getInfo
()

Returns the info property from an OpenAPI instance.

public String

Returns:

the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
getOpenapi
()

Returns the openapi property from an OpenAPI instance.

public Paths

Returns:

the available paths and operations for the API
getPaths
()

Returns the paths property from an OpenAPI instance.

public List<SecurityRequirement>

Returns:

a copy List (potentially immutable) containing the security mechanisms that can be used across the API
getSecurity
()

Returns the security property from an OpenAPI instance.

public List<Server>

Returns:

a copy List (potentially immutable) of Server objects which provide connectivity information to target servers
getServers
()

Returns the Servers defined in the API

public List<Tag>

Returns:

a copy List (potentially immutable) of tags defined in this the specification
getTags
()

Returns the tags property from an OpenAPI instance.

public Map<String, PathItem>

Returns:

a copy Map (potentially immutable) of named webhook definitions
getWebhooks
()

Returns the webhooks property of this OpenAPI instance.

public default OpenAPI

Returns:

the current OpenAPI object
info
(Info
metadata about the API
info
)

Sets this OpenAPI instance's info property to the given object.

public default OpenAPI

Returns:

the current OpenAPI object
openapi
(String
the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
openapi
)

Sets this OpenAPI instance's openapi property to the given string.

public default OpenAPI

Returns:

the current OpenAPI object
paths
(Paths
the available paths and operations for the API
paths
)

Sets this OpenAPI instance's paths property to the given paths.

public void
removeSecurityRequirement(SecurityRequirement
security mechanism which can be used across the API
securityRequirement
)

Removes the given security requirement to this OpenAPI instance's list of security requirements.

public void
removeServer(Server
Server object which provides connectivity information to a target server
server
)

Removes the given server to this OpenAPI instance's list of servers.

public void
removeTag(Tag
a tag used by the specification with additional metadata
tag
)

Removes the given tag to this OpenAPI instance's list of tags.

public void
removeWebhook(String
unique name of the webhook to remove
name
)

Removes a webhook definition.

public default OpenAPI

Returns:

the current OpenAPI object
security
(List<SecurityRequirement>
which security mechanisms can be used across the API
security
)

Sets this OpenAPI instance's security property to the given list.

public default OpenAPI

Returns:

the current OpenAPI object
servers
(List<Server>
Server objects which provide connectivity information to target servers
servers
)

Sets this OpenAPI instance's servers property to the given servers.

public void
setComponents(Components
a set of reusable objects used in the API specification
components
)

Sets this OpenAPI instance's components property to the given components.

public void
setExternalDocs(ExternalDocumentation
additional external documentation.
externalDocs
)

Sets this OpenAPI instance's externalDocs property to the given object.

public void
setInfo(Info
metadata about the API
info
)

Sets this OpenAPI instance's info property to the given object.

public void
setOpenapi(String
the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
openapi
)

Sets this OpenAPI instance's openapi property to the given string.

public void
setPaths(Paths
the available paths and operations for the API
paths
)

Sets this OpenAPI instance's paths property to the given paths.

public void
setSecurity(List<SecurityRequirement>
which security mechanisms can be used across the API
security
)

Sets this OpenAPI instance's security property to the given list.

public void
setServers(List<Server>
Server objects which provide connectivity information to target servers
servers
)

Sets this OpenAPI instance's servers property to the given servers.

public void
setTags(List<Tag>
tags used by the specification with additional metadata
tags
)

Sets this OpenAPI instance's tags property to the given Tags.

public void
setWebhooks(Map<String, PathItem>
a map of named webhook definitions
webhooks
)

Sets the webhooks property of this OpenAPI instance.

public default OpenAPI

Returns:

the current OpenAPI object
tags
(List<Tag>
tags used by the specification with additional metadata
tags
)

Sets this OpenAPI instance's tags property to the given tags.

public default OpenAPI

Returns:

the current Schema instance
webhooks
(Map<String, PathItem>
a map of named webhook definitions
webhooks
)

Sets the webhooks property of this OpenAPI instance.

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

Method Detail

addSecurityRequirementback to summary
public OpenAPI addSecurityRequirement(SecurityRequirement securityRequirement)

Adds the given security requirement to this OpenAPI instance's list of security requirements.

Parameters
securityRequirement:SecurityRequirement

security mechanism which can be used across the API

Returns:OpenAPI

the current OpenAPI object

addServerback to summary
public OpenAPI addServer(Server server)

Adds the given server to this OpenAPI instance's list of servers.

Parameters
server:Server

Server object which provides connectivity information to a target server

Returns:OpenAPI

the current OpenAPI object

addTagback to summary
public OpenAPI addTag(Tag tag)

Adds the given tag to this OpenAPI instance's list of tags.

Parameters
tag:Tag

a tag used by the specification with additional metadata

Returns:OpenAPI

the current OpenAPI object

addWebhookback to summary
public OpenAPI addWebhook(String name, PathItem webhook)

Adds a webhook definition.

Parameters
name:String

unique name of the webhook to add

webhook:PathItem

webhook definition to add

Returns:OpenAPI

the current Schema instance

Since
4.0
componentsback to summary
public default OpenAPI components(Components components)

Sets this OpenAPI instance's components property to the given components.

Parameters
components:Components

a set of reusable objects used in the API specification

Returns:OpenAPI

the current OpenAPI object

externalDocsback to summary
public default OpenAPI externalDocs(ExternalDocumentation externalDocs)

Sets this OpenAPI instance's externalDocs property to the given object.

Parameters
externalDocs:ExternalDocumentation

additional external documentation

Returns:OpenAPI

the current OpenAPI object

getComponentsback to summary
public Components getComponents()

Returns the components property from an OpenAPI instance.

Returns:Components

schemas used in the specification

getExternalDocsback to summary
public ExternalDocumentation getExternalDocs()

Returns the externalDocs property from an OpenAPI instance.

Returns:ExternalDocumentation

additional external documentation

getInfoback to summary
public Info getInfo()

Returns the info property from an OpenAPI instance.

Returns:Info

metadata about the API

getOpenapiback to summary
public String getOpenapi()

Returns the openapi property from an OpenAPI instance.

Returns:String

the semantic version number of the OpenAPI Specification version that the OpenAPI document uses

getPathsback to summary
public Paths getPaths()

Returns the paths property from an OpenAPI instance.

Returns:Paths

the available paths and operations for the API

getSecurityback to summary
public List<SecurityRequirement> getSecurity()

Returns the security property from an OpenAPI instance.

Returns:List<SecurityRequirement>

a copy List (potentially immutable) containing the security mechanisms that can be used across the API

getServersback to summary
public List<Server> getServers()

Returns the Servers defined in the API

Returns:List<Server>

a copy List (potentially immutable) of Server objects which provide connectivity information to target servers

getTagsback to summary
public List<Tag> getTags()

Returns the tags property from an OpenAPI instance.

Returns:List<Tag>

a copy List (potentially immutable) of tags defined in this the specification

getWebhooksback to summary
public Map<String, PathItem> getWebhooks()

Returns the webhooks property of this OpenAPI instance.

Returns:Map<String, PathItem>

a copy Map (potentially immutable) of named webhook definitions

Since
4.0
infoback to summary
public default OpenAPI info(Info info)

Sets this OpenAPI instance's info property to the given object.

Parameters
info:Info

metadata about the API

Returns:OpenAPI

the current OpenAPI object

openapiback to summary
public default OpenAPI openapi(String openapi)

Sets this OpenAPI instance's openapi property to the given string.

Parameters
openapi:String

the semantic version number of the OpenAPI Specification version that the OpenAPI document uses

Returns:OpenAPI

the current OpenAPI object

pathsback to summary
public default OpenAPI paths(Paths paths)

Sets this OpenAPI instance's paths property to the given paths.

Parameters
paths:Paths

the available paths and operations for the API

Returns:OpenAPI

the current OpenAPI object

removeSecurityRequirementback to summary
public void removeSecurityRequirement(SecurityRequirement securityRequirement)

Removes the given security requirement to this OpenAPI instance's list of security requirements.

Parameters
securityRequirement:SecurityRequirement

security mechanism which can be used across the API

removeServerback to summary
public void removeServer(Server server)

Removes the given server to this OpenAPI instance's list of servers.

Parameters
server:Server

Server object which provides connectivity information to a target server

removeTagback to summary
public void removeTag(Tag tag)

Removes the given tag to this OpenAPI instance's list of tags.

Parameters
tag:Tag

a tag used by the specification with additional metadata

removeWebhookback to summary
public void removeWebhook(String name)

Removes a webhook definition.

Parameters
name:String

unique name of the webhook to remove

Since
4.0
securityback to summary
public default OpenAPI security(List<SecurityRequirement> security)

Sets this OpenAPI instance's security property to the given list.

Parameters
security:List<SecurityRequirement>

which security mechanisms can be used across the API

Returns:OpenAPI

the current OpenAPI object

serversback to summary
public default OpenAPI servers(List<Server> servers)

Sets this OpenAPI instance's servers property to the given servers.

Parameters
servers:List<Server>

Server objects which provide connectivity information to target servers

Returns:OpenAPI

the current OpenAPI object

setComponentsback to summary
public void setComponents(Components components)

Sets this OpenAPI instance's components property to the given components.

Parameters
components:Components

a set of reusable objects used in the API specification

setExternalDocsback to summary
public void setExternalDocs(ExternalDocumentation externalDocs)

Sets this OpenAPI instance's externalDocs property to the given object.

Parameters
externalDocs:ExternalDocumentation

additional external documentation.

setInfoback to summary
public void setInfo(Info info)

Sets this OpenAPI instance's info property to the given object.

Parameters
info:Info

metadata about the API

setOpenapiback to summary
public void setOpenapi(String openapi)

Sets this OpenAPI instance's openapi property to the given string.

Parameters
openapi:String

the semantic version number of the OpenAPI Specification version that the OpenAPI document uses

setPathsback to summary
public void setPaths(Paths paths)

Sets this OpenAPI instance's paths property to the given paths.

Parameters
paths:Paths

the available paths and operations for the API

setSecurityback to summary
public void setSecurity(List<SecurityRequirement> security)

Sets this OpenAPI instance's security property to the given list.

Parameters
security:List<SecurityRequirement>

which security mechanisms can be used across the API

setServersback to summary
public void setServers(List<Server> servers)

Sets this OpenAPI instance's servers property to the given servers.

Parameters
servers:List<Server>

Server objects which provide connectivity information to target servers

setTagsback to summary
public void setTags(List<Tag> tags)

Sets this OpenAPI instance's tags property to the given Tags.

Parameters
tags:List<Tag>

tags used by the specification with additional metadata

setWebhooksback to summary
public void setWebhooks(Map<String, PathItem> webhooks)

Sets the webhooks property of this OpenAPI instance.

Parameters
webhooks:Map<String, PathItem>

a map of named webhook definitions

Since
4.0
tagsback to summary
public default OpenAPI tags(List<Tag> tags)

Sets this OpenAPI instance's tags property to the given tags.

Parameters
tags:List<Tag>

tags used by the specification with additional metadata

Returns:OpenAPI

the current OpenAPI object

webhooksback to summary
public default OpenAPI webhooks(Map<String, PathItem> webhooks)

Sets the webhooks property of this OpenAPI instance.

Parameters
webhooks:Map<String, PathItem>

a map of named webhook definitions

Returns:OpenAPI

the current Schema instance

Since
4.0