Summary
src/reqstool/resources/schemas/v1/annotations.schema.json's elementKind enum is [CLASS, ENUM, INTERFACE, RECORD, METHOD, FIELD], but Java's javax.lang.model.element.ElementKind also reports ANNOTATION_TYPE for @interface declarations.
Repro
reqstool-java-annotations' @Requirements/@SVCs both have @Target(ElementType.TYPE) among their targets, so they can legally annotate any type declaration — including an annotation type declaration (e.g. @Requirements("X") public @interface Requirements { ... }, self-applying the annotation to its own declaration). The annotation processor (AbstractAnnotationsProcessor) records element.getKind() faithfully, which is ANNOTATION_TYPE in this case, not CLASS/INTERFACE.
reqstool status/validate then fails schema validation:
ERROR:root:Syntax error(s) for urn '...' using schema: annotations.schema.json
ERROR:root: 1. 'ANNOTATION_TYPE' is not one of ['CLASS', 'ENUM', 'INTERFACE', 'RECORD', 'METHOD', 'FIELD']
Found while dogfooding reqstool-java-annotations itself (self-applying its own @Requirements to its Requirements/SVCs annotation declarations) — part of the org-wide OpenSpec/reqstool dogfooding rollout.
Fix
Add ANNOTATION_TYPE to the elementKind enum and regenerate the Pydantic model via hatch run dev:codegen. PR incoming.
Summary
src/reqstool/resources/schemas/v1/annotations.schema.json'selementKindenum is[CLASS, ENUM, INTERFACE, RECORD, METHOD, FIELD], but Java'sjavax.lang.model.element.ElementKindalso reportsANNOTATION_TYPEfor@interfacedeclarations.Repro
reqstool-java-annotations'@Requirements/@SVCsboth have@Target(ElementType.TYPE)among their targets, so they can legally annotate any type declaration — including an annotation type declaration (e.g.@Requirements("X") public @interface Requirements { ... }, self-applying the annotation to its own declaration). The annotation processor (AbstractAnnotationsProcessor) recordselement.getKind()faithfully, which isANNOTATION_TYPEin this case, notCLASS/INTERFACE.reqstool status/validatethen fails schema validation:Found while dogfooding
reqstool-java-annotationsitself (self-applying its own@Requirementsto itsRequirements/SVCsannotation declarations) — part of the org-wide OpenSpec/reqstool dogfooding rollout.Fix
Add
ANNOTATION_TYPEto theelementKindenum and regenerate the Pydantic model viahatch run dev:codegen. PR incoming.