@Retention(value=RUNTIME) public @interface RamlBody
This annotation is used to help describe a RAML body type for both requests and responses.
RamlResponse,
RamlRequests| Modifier and Type | Required Element and Description |
|---|---|
String |
contentType
The content type of the body(eg.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
example
The example for this body type.
|
boolean |
isCollection
Indicate that the returned type is a collection of the provided type.
|
String |
schema
The schema for this body type.
|
Class<?> |
type
A reference to the object type used for this body.
|
public abstract String contentType
The content type of the body(eg. “application/json”)
public abstract Class<?> type
A reference to the object type used for this body.
If this is supplied, the generator will attempt to use an appropriate generator to generate a schema document for the object.
If the object has a @RamlExample annotated static method that returns a concrete example of the type, the generator will use that to create an example payload.
If not value is provided here, the generator will resort to the contents of the schema() and example() properties to derive body schema and example
public abstract boolean isCollection
Indicate that the returned type is a collection of the provided type.
Defaulted to false, assuming that the return types for the most part are single documents rather than collections.
type()public abstract String schema
The schema for this body type. The value in here can make reference to a classpath resource or a direct text entry.
This will be used to supply a schema in the RAML specification if the type() property has not be defined.
public abstract String example
The example for this body type. The value in here can make reference to a classpath resource or a direct text entry.
This will be used to supply a schema in the RAML specification if the type() property has not been defined.
Copyright © 2020. All rights reserved.