Annotation Interface ApiDoc
Generated endpoint documentation is opt-in. Place @ApiDoc on a package, handler type, or handler method to
include the matching web endpoints; an empty annotation is enough when route, parameter, request, and response
information can be inferred from the existing web handler annotations. Use populated @ApiDoc values only for
metadata that cannot be inferred reliably, such as descriptions, tags, or a stable operation id. The annotation can
also be used on fields, parameters, record components, and type uses; for example
List<@ApiDoc(description = "Connection item") Connection> documents array items without requiring
OpenAPI-specific array annotations. Schema hints such as type(), format(), example(),
defaultValue(), and allowableValues() provide an SDK-native alternative for the common
documentation metadata that projects often express with OpenAPI-specific annotations.
When using the annotation processor, source Javadoc on schema types and properties in the same javac compilation is
used as a final description fallback after explicit @ApiDoc metadata and OpenAPI @Schema metadata.
Javadoc from already compiled dependency classes is not available to javac processors; use @ApiDoc when schema
documentation must cross module boundaries.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]Optional allowed string values for enum-like schemas.Optional schema default value.booleanMarks generated operations as deprecated.Longer description for the domain or endpoint.Optional schema example.Optional schema format override.Class<?> Optional schema implementation override for abstract, interface, or otherwise ambiguous fields.Optional inclusive numeric maximum.Optional inclusive numeric minimum.Stable operation identifier for generated specs.booleanMarks a schema property or parameter as required in generated docs.String[]OpenAPI security requirements for generated operations.Short endpoint summary.String[]Tags to associate with generated operations.Optional schema type override, such asstring,integer,number,boolean,object, orarray.
-
Element Details
-
summary
-
description
-
operationId
-
tags
-
type
String typeOptional schema type override, such asstring,integer,number,boolean,object, orarray. Valuesdate,date-time,uuid,uri,email, andbinaryare treated as string formats.- Default:
""
-
format
-
example
String exampleOptional schema example. JSON object/array examples are parsed when possible; scalar examples are coerced to the inferred schema type when possible.- Default:
""
-
defaultValue
String defaultValueOptional schema default value. Values are coerced to the inferred schema type when possible.- Default:
""
-
minimum
-
maximum
-
allowableValues
-
required
boolean requiredMarks a schema property or parameter as required in generated docs.- Default:
false
-
implementation
Class<?> implementationOptional schema implementation override for abstract, interface, or otherwise ambiguous fields.- Default:
java.lang.Void.class
-
deprecated
boolean deprecatedMarks generated operations as deprecated.- Default:
false
-
security
String[] securityOpenAPI security requirements for generated operations.Values are rendered as security requirement objects. Use
bearerAuthfor a scheme without scopes, oroauth2=read,writefor scoped schemes.- Default:
{}
-