Class ResponseInfo
The Response Object describes a single response from a Swagger 2.0 API operation, including a description, schema, headers, and examples. Responses are associated with HTTP status codes (e.g., 200, 404, 500).
Swagger Specification:
The Response Object is composed of the following fields:
- description (string, REQUIRED) - A short description of the response
- schema (- SchemaInfo) - A definition of the response structure
- headers (map of- HeaderInfo) - Maps a header name to its definition
- examples (map of any) - An example of the response message (keys are media types)
Example:
   
   
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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> TGeneric 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 .strict()Sets strict mode on this bean.Sets strict mode on this bean.
- 
Constructor Details- 
ResponseInfopublic ResponseInfo()Default constructor.
- 
ResponseInfoCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
copyMake a deep copy of this object.- Returns:
- A deep copy of this object.
 
- 
copyFromCopies any non-null fields from the specified object to this object.- Parameters:
- r- The object to copy fields from.
 Can be- null .
- Returns:
- This object.
 
- 
getDescriptionBean property getter:description .A short description of the response. - Returns:
- The property value, or null if it is not set.
 
- 
setDescriptionBean 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.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
getExamplesBean property getter:examples .An example of the response message. - Returns:
- The property value, or null if it is not set.
 
- 
setExamplesBean property setter:examples .An example of the response message. - Parameters:
- value- The new value for this property.
 Keys must be MIME-type strings.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
addExampleBean property appender:examples .Adds a single value to the examples property.- Parameters:
- mimeType- The mime-type string. Must not be- null .
- example- The example. Must not be- null .
- Returns:
- This object.
 
- 
getHeadersBean property getter:headers .A list of headers that are sent with the response. - Returns:
- The property value, or null if it is not set.
 
- 
setHeadersBean property setter:headers .A list of headers that are sent with the response. - Parameters:
- value- The new value for this property.
 Can be- null to unset the property.
- Returns:
- This object.
 
- 
addHeaderBean property appender:headers .- Parameters:
- name- The header name. Must not be- null .
- header- The header descriptions Must not be- null .
- Returns:
- This object.
 
- 
getHeaderReturns the header information with the specified name.- Parameters:
- name- The header name. Must not be- null .
- Returns:
- The header info, or null if not found.
 
- 
getSchemaBean property getter:schema .A definition of the response structure. - Returns:
- The property value, or null if it is not set.
 
- 
setSchemaBean 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 be- null to unset the property.
- Returns:
- This object.
 
- 
getDescription copied from class:SwaggerElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- SwaggerElement
- 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:SwaggerElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- SwaggerElement
- 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:SwaggerElementReturns all the keys on this element.- Overrides:
- keySetin class- SwaggerElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
resolveRefsResolves 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.
 
- 
strictSets strict mode on this bean.- Overrides:
- strictin class- SwaggerElement
- Returns:
- This object.
 
- 
strictSets strict mode on this bean.- Overrides:
- strictin class- SwaggerElement
- 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.
 
 
-