Class OpenApi
The OpenAPI Object is the root document that describes an entire API. It contains metadata about the API, available paths and operations, parameters, responses, authentication methods, and other information.
OpenAPI Specification:
The OpenAPI Object is composed of the following fields:
- openapi (string, REQUIRED) - The OpenAPI Specification version (e.g., "3.0.0")
- info (- Info, REQUIRED) - Provides metadata about the API
- servers (array of- Server) - An array of Server Objects providing connectivity information
- paths (map of- PathItem) - The available paths and operations for the API
- components (- Components) - An element to hold various schemas for reuse
- security (array of- SecurityRequirement) - Security mechanisms applied to all operations
- tags (array of- Tag) - A list of tags for API documentation control
- externalDocs (- ExternalDocumentation) - Additional external documentation
Example:
   
See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a path to this OpenAPI document.addSecurity(Collection<SecurityRequirement> values) Bean property fluent setter:security .addSecurity(SecurityRequirement... values) Bean property fluent setter:security .addServers(Collection<Server> values) Bean property fluent setter:servers .addServers(Server... values) Bean property fluent setter:servers .addTags(Collection<Tag> values) Bean property appender:tags .Bean property appender:tags .copy()Make a deep copy of this object.<T> TFinds a reference within this OpenAPI document.<T> TGeneric property getter.Returns the components object.Returns the external documentation.getInfo()Returns the info object.Returns the OpenAPI version.getPaths()Returns the paths map.Returns the security requirements list.Returns the servers list.getTags()Returns the tags list.keySet()Returns all the keys on this element.Generic property setter.setComponents(Components value) Sets the components object.Sets the external documentation.Sets the info object.setOpenapi(String value) Sets the OpenAPI version.Sets the paths map.setSecurity(List<SecurityRequirement> value) Sets the security requirements list.setServers(List<Server> value) Sets the servers list.Sets the tags list.Bean property setter:tags .strict()Sets strict mode on this bean.Sets strict mode on this bean.toString()Methods inherited from class org.apache.juneau.bean.openapi3.OpenApiElementasMap, extraKeys, get, isStrict
- 
Field Details- 
NULLRepresents a null OpenAPI document
 
- 
- 
Constructor Details- 
OpenApipublic OpenApi()Default constructor.
- 
OpenApiCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
copyMake a deep copy of this object.- Returns:
- A deep copy of this object.
 
- 
getOpenapiReturns the OpenAPI version.- Returns:
- The OpenAPI version.
 
- 
setOpenapiSets the OpenAPI version.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getInfoReturns the info object.- Returns:
- The info object.
 
- 
setInfoSets the info object.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getServersReturns the servers list.- Returns:
- The servers list.
 
- 
setServersSets the servers list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getPathsReturns the paths map.- Returns:
- The paths map.
 
- 
setPathsSets the paths map.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
addPathAdds a path to this OpenAPI document.- Parameters:
- path- The path string. Must not be- null .
- pathItem- The path item. Must not be- null .
- Returns:
- This object.
 
- 
getComponentsReturns the components object.- Returns:
- The components object.
 
- 
setComponentsSets the components object.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getSecurityReturns the security requirements list.- Returns:
- The security requirements list.
 
- 
setSecuritySets the security requirements list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
getTagsReturns the tags list.- Returns:
- The tags list.
 
- 
setTagsSets the tags list.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
setTagsBean property setter:tags .A list of tags used by the specification with additional metadata. - Parameters:
- value- The new value for this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addTagsBean property appender:tags .A list of tags used by the specification with additional metadata. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addTagsBean property appender:tags .A list of tags used by the specification with additional metadata. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addServersBean property fluent setter:servers .An array of Server Objects, which provide connectivity information to a target server. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addServersBean property fluent setter:servers .An array of Server Objects, which provide connectivity information to a target server. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addSecurityBean property fluent setter:security .A declaration of which security mechanisms can be used across the API. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
addSecurityBean property fluent setter:security .A declaration of which security mechanisms can be used across the API. - Parameters:
- values- The values to add to this property.
 Ignored if- null .
- Returns:
- This object.
 
- 
getExternalDocsReturns the external documentation.- Returns:
- The external documentation.
 
- 
setExternalDocsSets the external documentation.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
findRefFinds a reference within this OpenAPI document.- Parameters:
- ref- The reference string (e.g.,- "#/components/schemas/User" ). Must not be- null or blank.
- c- The expected class type. Must not be- null .
- Returns:
- The referenced node, or null if not found.
 
- 
toString- Overrides:
- toStringin class- OpenApiElement
 
- 
getDescription copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- OpenApiElement
- Type Parameters:
- T- The datatype to cast the value to.
- Parameters:
- property- The property name to retrieve.
- type- The datatype to cast the value to.
- Returns:
- The property value, or null if the property does not exist or is not set.
 
- 
setDescription copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- OpenApiElement
- Parameters:
- property- The property name to set. Must not be- null .
- value- The new value for the property.
- Returns:
- This object
 
- 
keySetDescription copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
- keySetin class- OpenApiElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Returns:
- This object
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Parameters:
- value- The new value for this property.
 Non-boolean values will be converted to boolean using- Boolean..- valueOf (value.toString())
 Can be- null (interpreted as- false ).
- Returns:
- This object
 
 
-