Class OpenApiProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
io.fluxzero.sdk.web.OpenApiProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes({"io.fluxzero.sdk.web.ApiDoc","io.fluxzero.sdk.web.ApiDocInfo","io.fluxzero.sdk.web.ApiDocResponse","io.fluxzero.sdk.web.ApiDocResponses","io.fluxzero.sdk.web.ApiDocExclude","io.fluxzero.sdk.web.Path","io.fluxzero.sdk.web.HandleWeb","io.fluxzero.sdk.web.HandleGet","io.fluxzero.sdk.web.HandlePost","io.fluxzero.sdk.web.HandlePut","io.fluxzero.sdk.web.HandlePatch","io.fluxzero.sdk.web.HandleDelete","io.fluxzero.sdk.web.HandleHead","io.fluxzero.sdk.web.HandleOptions","io.fluxzero.sdk.web.HandleTrace","io.fluxzero.sdk.web.HandleSocketHandshake","io.fluxzero.sdk.web.HandleSocketMessage","io.fluxzero.sdk.web.HandleSocketOpen","io.fluxzero.sdk.web.HandleSocketClose","io.fluxzero.sdk.web.HandleSocketPong","io.fluxzero.sdk.web.QueryParam","io.fluxzero.sdk.web.PathParam","io.fluxzero.sdk.web.HeaderParam","io.fluxzero.sdk.web.CookieParam","io.fluxzero.sdk.web.FormParam","io.fluxzero.sdk.web.BodyParam","io.swagger.v3.oas.annotations.media.Schema","io.swagger.v3.oas.annotations.media.ArraySchema","io.swagger.v3.oas.annotations.Hidden"})
@SupportedOptions({"fluxzero.openapi.enabled","fluxzero.openapi.output","fluxzero.openapi.specVersion","fluxzero.openapi.title","fluxzero.openapi.version","fluxzero.openapi.description","fluxzero.openapi.servers","org.gradle.annotation.processing.aggregating"})
public class OpenApiProcessor
extends AbstractProcessor
Generates an OpenAPI document from Fluxzero web handler annotations during Java compilation.
The processor is intentionally lightweight: it only inspects source elements in the current javac round, never scans the runtime classpath, and writes a single resource when at least one documented HTTP endpoint is found.
Compiler Options
- "fluxzero.openapi.enabled": set to
falseto disable generation. - "fluxzero.openapi.output": generated resource path, defaults to "META-INF/fluxzero/openapi.json".
- "fluxzero.openapi.specVersion": OpenAPI document version, defaults to
3.0.1. - "fluxzero.openapi.title": OpenAPI
info.title, defaults toFluxzero API. - "fluxzero.openapi.version": OpenAPI
info.version, defaults to0.0.0. - "fluxzero.openapi.description": optional OpenAPI
info.description. - "fluxzero.openapi.servers": comma-separated server URLs.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) Methods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Field Details
-
DEFAULT_OUTPUT
- See Also:
-
ENABLED_OPTION
- See Also:
-
OUTPUT_OPTION
- See Also:
-
OPENAPI_VERSION_OPTION
- See Also:
-
TITLE_OPTION
- See Also:
-
VERSION_OPTION
- See Also:
-
DESCRIPTION_OPTION
- See Also:
-
SERVERS_OPTION
- See Also:
-
-
Constructor Details
-
OpenApiProcessor
public OpenApiProcessor()
-
-
Method Details
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-