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> TGeneric 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
-
copy
Creates a copy of this object.- Returns:
- A copy of this object.
-
get
Description copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
getin 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.
-
getCallbacks
Returns the callbacks map.- Returns:
- The callbacks map.
-
getExamples
Returns the examples map.- Returns:
- The examples map.
-
getHeaders
Returns the headers map.- Returns:
- The headers map.
-
getLinks
Returns the links map.- Returns:
- The links map.
-
getParameters
Returns the parameters map.- Returns:
- The parameters map.
-
getRequestBodies
Returns the request bodies map.- Returns:
- The request bodies map.
-
getResponses
Returns the responses map.- Returns:
- The responses map.
-
getSchemas
Returns the schemas map.- Returns:
- The schemas map.
-
getSecuritySchemes
Returns the security schemes map.- Returns:
- The security schemes map.
-
keySet
Description copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
keySetin classOpenApiElement- Returns:
- All the keys on this element.
Nevernull .
-
set
Description copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
setin classOpenApiElement- Parameters:
property- The property name to set. Must not benull .value- The new value for the property.- Returns:
- This object
-
setCallbacks
Sets the callbacks map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setExamples
Sets the examples map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setHeaders
Sets the headers map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setLinks
Sets the links map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setParameters
Sets the parameters map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setRequestBodies
Sets the request bodies map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setResponses
Sets the responses map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setSchemas
Sets the schemas map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
setSecuritySchemes
Sets the security schemes map.- Parameters:
value- The new value for this property.- Returns:
- This object.
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin classOpenApiElement- Returns:
- This object
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin 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
-