Annotation Interface ApiDocResponse
@Retention(RUNTIME)
@Target({METHOD,CONSTRUCTOR,TYPE,PACKAGE})
@Repeatable(ApiDocResponses.class)
@Documented
public @interface ApiDocResponse
Adds an explicit response entry to generated API documentation.
Handler return types are inferred automatically. Use this annotation for additional status codes, error responses, or response descriptions that cannot be derived from the method signature.
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionOptional response content type.Response description.Optional reusable response reference.Class<?> Optional response body type.
-
Element Details
-
status
int statusHTTP status code. -
description
-
ref
String refOptional reusable response reference.A bare value such as
erroris resolved to#/components/responses/error. A value starting with#/is used as-is. When set,description(),type(), andcontentType()are ignored because OpenAPI Reference Objects cannot have response-object siblings in OpenAPI 3.0.- Default:
""
-
type
Class<?> typeOptional response body type.Void.classmeans no explicit type was provided.- Default:
java.lang.Void.class
-
contentType
-