@Documented @Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) public @interface Produces
An annotation to indicate the MediaType
s produced by a particular component.
Generally with controllers one can use the produces
attribute of the Controller
annotation,
however this annotation is more generic and applies to any component
public abstract boolean single
In the case of reactive types this member indicates whether only a single result is returned. Normally this annotation is unnecessary unless the declared type doesn't indicate how many items are emitted.
For JSON with single=false if an Reactive streams Publisher type is returned these will be automatically wrapped in an Array type to ensure valid JSON is returned.
If single=true it is expected that only a single result will be emitted and the result will not be wrapped in a JSON array.