Interface OpenAPI
- All Superinterfaces:
Constructible
,Extensible<OpenAPI>
OpenAPI
This is the root document object of the OpenAPI document. It contains required and optional fields.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddSecurityRequirement
(SecurityRequirement securityRequirement) Adds the given security requirement to this OpenAPI instance's list of security requirements.Adds the given server to this OpenAPI instance's list of servers.Adds the given tag to this OpenAPI instance's list of tags.default OpenAPI
components
(Components components) Sets this OpenAPI instance's components property to the given components.default OpenAPI
externalDocs
(ExternalDocumentation externalDocs) Sets this OpenAPI instance's externalDocs property to the given object.Returns the components property from an OpenAPI instance.Returns the externalDocs property from an OpenAPI instance.getInfo()
Returns the info property from an OpenAPI instance.Returns the openapi property from an OpenAPI instance.getPaths()
Returns the paths property from an OpenAPI instance.Returns the security property from an OpenAPI instance.Returns the Servers defined in the APIgetTags()
Returns the tags property from an OpenAPI instance.default OpenAPI
Sets this OpenAPI instance's info property to the given object.default OpenAPI
Sets this OpenAPI instance's openapi property to the given string.default OpenAPI
Sets this OpenAPI instance's paths property to the given paths.void
removeSecurityRequirement
(SecurityRequirement securityRequirement) Removes the given security requirement to this OpenAPI instance's list of security requirements.void
removeServer
(Server server) Removes the given server to this OpenAPI instance's list of servers.void
Removes the given tag to this OpenAPI instance's list of tags.default OpenAPI
security
(List<SecurityRequirement> security) Sets this OpenAPI instance's security property to the given list.default OpenAPI
Sets this OpenAPI instance's servers property to the given servers.void
setComponents
(Components components) Sets this OpenAPI instance's components property to the given components.void
setExternalDocs
(ExternalDocumentation externalDocs) Sets this OpenAPI instance's externalDocs property to the given object.void
Sets this OpenAPI instance's info property to the given object.void
setOpenapi
(String openapi) Sets this OpenAPI instance's openapi property to the given string.void
Sets this OpenAPI instance's paths property to the given paths.void
setSecurity
(List<SecurityRequirement> security) Sets this OpenAPI instance's security property to the given list.void
setServers
(List<Server> servers) Sets this OpenAPI instance's servers property to the given servers.void
Sets this OpenAPI instance's tags property to the given Tags.default OpenAPI
Sets this OpenAPI instance's tags property to the given tags.Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
Method Details
-
getOpenapi
String getOpenapi()Returns the openapi property from an OpenAPI instance.- Returns:
- the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
-
setOpenapi
Sets this OpenAPI instance's openapi property to the given string.- Parameters:
openapi
- 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.- Parameters:
openapi
- the semantic version number of the OpenAPI Specification version that the OpenAPI document uses- Returns:
- the current OpenAPI object
-
getInfo
Info getInfo()Returns the info property from an OpenAPI instance.- Returns:
- metadata about the API
-
setInfo
Sets this OpenAPI instance's info property to the given object.- Parameters:
info
- metadata about the API
-
info
Sets this OpenAPI instance's info property to the given object.- Parameters:
info
- metadata about the API- Returns:
- the current OpenAPI object
-
getExternalDocs
ExternalDocumentation getExternalDocs()Returns the externalDocs property from an OpenAPI instance.- Returns:
- additional external documentation
-
setExternalDocs
Sets this OpenAPI instance's externalDocs property to the given object.- Parameters:
externalDocs
- additional external documentation.
-
externalDocs
Sets this OpenAPI instance's externalDocs property to the given object.- Parameters:
externalDocs
- additional external documentation- Returns:
- the current OpenAPI object
-
getServers
Returns the Servers defined in the API- Returns:
- a copy List (potentially immutable) of Server objects which provide connectivity information to target servers
-
setServers
Sets this OpenAPI instance's servers property to the given servers.- Parameters:
servers
- Server objects which provide connectivity information to target servers
-
servers
Sets this OpenAPI instance's servers property to the given servers.- Parameters:
servers
- Server objects which provide connectivity information to target servers- Returns:
- the current OpenAPI object
-
addServer
Adds the given server to this OpenAPI instance's list of servers.- Parameters:
server
- Server object which provides connectivity information to a target server- Returns:
- the current OpenAPI object
-
removeServer
Removes the given server to this OpenAPI instance's list of servers.- Parameters:
server
- Server object which provides connectivity information to a target server
-
getSecurity
List<SecurityRequirement> getSecurity()Returns the security property from an OpenAPI instance.- Returns:
- a copy List (potentially immutable) containing the security mechanisms that can be used across the API
-
setSecurity
Sets this OpenAPI instance's security property to the given list.- Parameters:
security
- which security mechanisms can be used across the API
-
security
Sets this OpenAPI instance's security property to the given list.- Parameters:
security
- which security mechanisms can be used across the API- Returns:
- the current OpenAPI object
-
addSecurityRequirement
Adds the given security requirement to this OpenAPI instance's list of security requirements.- Parameters:
securityRequirement
- security mechanism which can be used across the API- Returns:
- the current OpenAPI object
-
removeSecurityRequirement
Removes the given security requirement to this OpenAPI instance's list of security requirements.- Parameters:
securityRequirement
- security mechanism which can be used across the API
-
getTags
Returns the tags property from an OpenAPI instance.- Returns:
- a copy List (potentially immutable) of tags defined in this the specification
-
setTags
Sets this OpenAPI instance's tags property to the given Tags.- Parameters:
tags
- tags used by the specification with additional metadata
-
tags
Sets this OpenAPI instance's tags property to the given tags.- Parameters:
tags
- tags used by the specification with additional metadata- Returns:
- the current OpenAPI object
-
addTag
Adds the given tag to this OpenAPI instance's list of tags.- Parameters:
tag
- a tag used by the specification with additional metadata- Returns:
- the current OpenAPI object
-
removeTag
Removes the given tag to this OpenAPI instance's list of tags.- Parameters:
tag
- a tag used by the specification with additional metadata
-
getPaths
Paths getPaths()Returns the paths property from an OpenAPI instance.- Returns:
- the available paths and operations for the API
-
setPaths
Sets this OpenAPI instance's paths property to the given paths.- Parameters:
paths
- the available paths and operations for the API
-
paths
Sets this OpenAPI instance's paths property to the given paths.- Parameters:
paths
- the available paths and operations for the API- Returns:
- the current OpenAPI object
-
getComponents
Components getComponents()Returns the components property from an OpenAPI instance.- Returns:
- schemas used in the specification
-
setComponents
Sets this OpenAPI instance's components property to the given components.- Parameters:
components
- a set of reusable objects used in the API specification
-
components
Sets this OpenAPI instance's components property to the given components.- Parameters:
components
- a set of reusable objects used in the API specification- Returns:
- the current OpenAPI object
-