Skip to content

annotations.schema.json elementKind enum missing ANNOTATION_TYPE #418

Description

@jimisola

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions