Class ResponseInfo
Example:
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddExample
(String mimeType, Object example) Bean property appender:examples .addHeader
(String name, HeaderInfo header) Bean property appender:headers .copy()
Make a deep copy of this object.Copies any non-null fields from the specified object to this object.<T> T
Generic property getter.Bean property getter:description .Bean property getter:examples .Returns the header information with the specified name.Bean property getter:headers .Bean property getter:schema .keySet()
Returns all the keys on this element.resolveRefs
(Swagger swagger, Deque<String> refStack, int maxDepth) Resolves any"$ref" attributes in this element.Generic property setter.setDescription
(String value) Bean property setter:description .setExamples
(Map<String, Object> value) Bean property setter:examples .setHeaders
(Map<String, HeaderInfo> value) Bean property setter:headers .setSchema
(SchemaInfo value) Bean property setter:schema .
-
Constructor Details
-
ResponseInfo
public ResponseInfo()Default constructor. -
ResponseInfo
Copy constructor.- Parameters:
copyFrom
- The object to copy.
-
-
Method Details
-
copy
Make a deep copy of this object.- Returns:
- A deep copy of this object.
-
copyFrom
Copies any non-null fields from the specified object to this object.- Parameters:
r
- The object to copy fields from.
Can benull .- Returns:
- This object.
-
getDescription
Bean property getter:description .A short description of the response.
- Returns:
- The property value, or
null if it is not set.
-
setDescription
Bean property setter:description .A short description of the response.
- Parameters:
value
- The new value for this property.
GFM syntax can be used for rich text representation.
Property value is required.- Returns:
- This object.
-
getExamples
Bean property getter:examples .An example of the response message.
- Returns:
- The property value, or
null if it is not set.
-
setExamples
Bean property setter:examples .An example of the response message.
- Parameters:
value
- The new value for this property.
Keys must be MIME-type strings.
Can benull to unset the property.- Returns:
- This object.
-
addExample
Bean property appender:examples .Adds a single value to the
examples property.- Parameters:
mimeType
- The mime-type string.example
- The example.- Returns:
- This object.
-
getHeaders
Bean property getter:headers .A list of headers that are sent with the response.
- Returns:
- The property value, or
null if it is not set.
-
setHeaders
Bean property setter:headers .A list of headers that are sent with the response.
- Parameters:
value
- The new value for this property.
Can benull to unset the property.- Returns:
- This object.
-
addHeader
Bean property appender:headers .- Parameters:
name
- The header name.header
- The header descriptions- Returns:
- This object.
-
getHeader
Returns the header information with the specified name.- Parameters:
name
- The header name.- Returns:
- The header info, or
null if not found.
-
getSchema
Bean property getter:schema .A definition of the response structure.
- Returns:
- The property value, or
null if it is not set.
-
setSchema
Bean property setter:schema .A definition of the response structure.
- Parameters:
value
- The new value for this property.
It can be a primitive, an array or an object.
Can benull to unset the property.- Returns:
- This object.
-
get
Description copied from class:SwaggerElement
Generic property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
get
in classSwaggerElement
- 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:SwaggerElement
Generic property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
set
in classSwaggerElement
- Parameters:
property
- The property name to set.value
- The new value for the property.- Returns:
- This object.
-
keySet
Description copied from class:SwaggerElement
Returns all the keys on this element.- Overrides:
keySet
in classSwaggerElement
- Returns:
- All the keys on this element.
Nevernull .
-
resolveRefs
Resolves any"$ref" attributes in this element.- Parameters:
swagger
- The swagger document containing the definitions.refStack
- Keeps track of previously-visited references so that we don't cause recursive loops.maxDepth
- The maximum depth to resolve references.
After that level is reached,$ref references will be left alone.
Useful if you have very complex models and you don't want your swagger page to be overly-complex.- Returns:
- This object with references resolved.
May or may not be the same object.
-