Annotation Interface Response
Identifies an interface to use to interact with HTTP parts of an HTTP response through a bean.
Can be used in the following locations:
- Exception classes thrown from server-side @RestOp -annotated methods.
- Return type classes of server-side @RestOp -annotated methods.
- Arguments and argument-types of server-side @RestOp -annotated methods.
- Return type classes of server-side @RemoteOp -annotated methods.
- Client-side @RemoteOp -annotated methods.
- Return type interfaces of client-side @RemoteOp -annotated methods.
See Also:
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionString[]Optional description for the exposed API.String[]Serialized examples of the body of a response.Header[]headers field of the Swagger Response Object.String[]Dynamically apply this annotation to the specified classes.Class<?>[]Dynamically apply this annotation to the specified classes.Class<? extends HttpPartParser>Specifies theHttpPartParserclass used for parsing strings to values.schema field of the Swagger Response Object.Class<? extends HttpPartSerializer>Specifies theHttpPartSerializerclass used for serializing values to strings.
- 
Element Details- 
descriptionOptional description for the exposed API.- Returns:
- The annotation value.
- Since:
- 9.2.0
 - Default:
- {}
 
- 
examplesSerialized examples of the body of a response.This is a juneau-bean-swagger-v2 object whose keys are media types and values are string representations of that value. // A JSON representation of a PetCreate object. @Response ( examples={"'application/json':'{name:\\'Doggie\\',species:\\'Dog\\'}'," ,"'text/uon':'(name:Doggie,species=Dog)'" } )Used for:- Server-side generated Swagger documentation.
 Notes:- The format is a juneau-bean-swagger-v2 object with string keys (media type) and string values (example for that media type) .
- 
      The leading/trailing { } characters are optional.
- Multiple lines are concatenated with newlines so that you can format the value to be readable:
- 
      Supports SVL Variables (e.g. "$L{my.localized.variable}" ) for the swagger generator.
- 
      Resolution of variables is delayed until request time and occurs before parsing.
      
 This allows you to, for example, pull in a JSON construct from a properties file based on the locale of the HTTP request.
 - Returns:
- The annotation value.
 - Default:
- {}
 
- 
headersheaders field of the Swagger Response Object.Used for:- Server-side generated Swagger documentation.
 - Returns:
- The annotation value.
 - Default:
- {}
 
- 
onDynamically apply this annotation to the specified classes.See Also:- Returns:
- The annotation value.
 - Default:
- {}
 
- 
onClassDynamically apply this annotation to the specified classes.Identical to on()except allows you to specify class objects instead of a strings.See Also:- Returns:
- The annotation value.
 - Default:
- {}
 
- 
parserClass<? extends HttpPartParser> parserSpecifies theHttpPartParserclass used for parsing strings to values.Overrides for this part the part parser defined on the REST resource which by default is OpenApiParser.- Returns:
- The annotation value.
 - Default:
- org.apache.juneau.httppart.HttpPartParser.Void.class
 
- 
schemaschema field of the Swagger Response Object.Used for:- Server-side schema-based serializing and serializing validation.
- Server-side generated Swagger documentation.
 - Returns:
- The annotation value.
 - Default:
- @org.apache.juneau.annotation.Schema
 
- 
serializerClass<? extends HttpPartSerializer> serializerSpecifies theHttpPartSerializerclass used for serializing values to strings.Overrides for this part the part serializer defined on the REST resource which by default is OpenApiSerializer.- Returns:
- The annotation value.
 - Default:
- org.apache.juneau.httppart.HttpPartSerializer.Void.class
 
 
-