Class Components
The Components Object holds a set of reusable objects that can be referenced from other parts of the API specification.
This promotes reusability and reduces duplication by allowing common schemas, responses, parameters, and other objects
to be defined once and referenced multiple times using the
OpenAPI Specification:
The Components Object is composed of the following fields:
schemas (map ofSchemaInfo
) - Reusable schema definitionsresponses (map ofResponse
) - Reusable response definitionsparameters (map ofParameter
) - Reusable parameter definitionsexamples (map ofExample
) - Reusable example definitionsrequestBodies (map ofRequestBodyInfo
) - Reusable request body definitionsheaders (map ofHeaderInfo
) - Reusable header definitionssecuritySchemes (map ofSecuritySchemeInfo
) - Reusable security scheme definitionslinks (map ofLink
) - Reusable link definitionscallbacks (map ofCallback
) - Reusable callback definitions
Example:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of this object.<T> T
Generic property getter.Returns the callbacks map.Returns the examples map.Returns the headers map.getLinks()
Returns the links map.Returns the parameters map.Returns the request bodies map.Returns the responses map.Returns the schemas map.Returns the security schemes map.keySet()
Returns all the keys on this element.Generic property setter.setCallbacks
(Map<String, Callback> value) Sets the callbacks map.setExamples
(Map<String, Example> value) Sets the examples map.setHeaders
(Map<String, HeaderInfo> value) Sets the headers map.Sets the links map.setParameters
(Map<String, Parameter> value) Sets the parameters map.setRequestBodies
(Map<String, RequestBodyInfo> value) Sets the request bodies map.setResponses
(Map<String, Response> value) Sets the responses map.setSchemas
(Map<String, SchemaInfo> value) Sets the schemas map.Sets the security schemes map.strict()
Sets strict mode on this bean.Sets strict mode on this bean.
-
Constructor Details
-
Components
public Components()Default constructor. -
Components
Copy constructor.- Parameters:
copyFrom
- The object to copy.
-
-
Method Details
-
getSchemas
Returns the schemas map.- Returns:
- The schemas map.
-
setSchemas
Sets the schemas map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getResponses
Returns the responses map.- Returns:
- The responses map.
-
setResponses
Sets the responses map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getParameters
Returns the parameters map.- Returns:
- The parameters map.
-
setParameters
Sets the parameters map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getExamples
Returns the examples map.- Returns:
- The examples map.
-
setExamples
Sets the examples map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getRequestBodies
Returns the request bodies map.- Returns:
- The request bodies map.
-
setRequestBodies
Sets the request bodies map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getHeaders
Returns the headers map.- Returns:
- The headers map.
-
setHeaders
Sets the headers map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getSecuritySchemes
Returns the security schemes map.- Returns:
- The security schemes map.
-
setSecuritySchemes
Sets the security schemes map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getLinks
Returns the links map.- Returns:
- The links map.
-
setLinks
Sets the links map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
getCallbacks
Returns the callbacks map.- Returns:
- The callbacks map.
-
setCallbacks
Sets the callbacks map.- Parameters:
value
- The new value for this property.- Returns:
- This object.
-
copy
Creates a copy of this object.- Returns:
- A copy of this object.
-
get
Description copied from class:OpenApiElement
Generic property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
get
in classOpenApiElement
- 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.
-
set
Description copied from class:OpenApiElement
Generic property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
set
in classOpenApiElement
- Parameters:
property
- The property name to set. Must not benull .value
- The new value for the property.- Returns:
- This object
-
keySet
Description copied from class:OpenApiElement
Returns all the keys on this element.- Overrides:
keySet
in classOpenApiElement
- Returns:
- All the keys on this element.
Nevernull .
-
strict
Description copied from class:OpenApiElement
Sets strict mode on this bean.- Overrides:
strict
in classOpenApiElement
- Returns:
- This object
-
strict
Description copied from class:OpenApiElement
Sets strict mode on this bean.- Overrides:
strict
in classOpenApiElement
- Parameters:
value
- The new value for this property.
Non-boolean values will be converted to boolean usingBoolean.
.valueOf (value.toString())
Can benull (interpreted asfalse ).- Returns:
- This object
-