@Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) public @interface ResponseType
This annotation can be placed on a single method and also on a class. When it's on a class that means it's applied to all methods in this class. That's useful for declaring error types, as they are usually the same for all methods.
Use ResponseTypes annotation to declare more than one return type.
| Modifier and Type | Required Element and Description |
|---|---|
Class<?> |
value
Type of the returned response.
|
| Modifier and Type | Optional Element and Description |
|---|---|
Class<?>[] |
genericTypes
If the response class is generic you are supposed to provide all its generic types here.
|
int |
status
Status for which this type applies.
|
ResponseType.StatusType |
statusType
General type of the status.
|
public abstract Class<?> value
public abstract int status
public abstract ResponseType.StatusType statusType
Instead of specifying an exact status, you can select a group of statues. If any status from the group is present in the method's javadoc, it will have a schema generated for the type declared here.
public abstract Class<?>[] genericTypes
Copyright © 2017 Atlassian. All rights reserved.