Tag APIs JSON Not Empty

tag-apis-json-not-empty

info experience: discoverability spec: tags

tags should not be empty.

If tags are declared they should not be empty — tags drive discovery in the catalog.

Rule definition

The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.

tag-apis-json-not-empty:
  title: Tag APIs JSON Not Empty
  reference: https://spotlight-rules.com/spec/rules/apis-json/tag-apis-json-not-empty/
  description: If tags are declared they should not be empty — tags drive
    discovery in the catalog.
  message: tags should not be empty.
  given: $.tags
  severity: info
  then:
    function: schema
    functionOptions:
      schema:
        type: array
        minItems: 1
  tags:
    - format:apis-json
    - spec:tags
    - experience:discoverability
  prompt: "You are editing an APIs.json document to satisfy the Spotlight API
    governance rule 'tag-apis-json-not-empty' (Tag APIs JSON Not Empty).
    Requirement: If tags are declared they should not be empty — tags drive
    discovery in the catalog. To fix: Adjust the targeted value so it conforms
    to the schema this rule requires. This rule is evaluated at the JSONPath
    `$.tags` — inspect every location it matches and correct only what violates
    the rule. Make the smallest change that satisfies the rule, leave all
    unrelated content, key order, comments, and formatting unchanged, and keep
    the document valid APIs.json. Return only the complete corrected document,
    with no commentary."
AI fix prompt — send this to Claude, Gemini, or ChatGPT with your artifact to auto-fix this rule
You are editing an APIs.json document to satisfy the Spotlight API governance rule 'tag-apis-json-not-empty' (Tag APIs JSON Not Empty). Requirement: If tags are declared they should not be empty — tags drive discovery in the catalog. To fix: Adjust the targeted value so it conforms to the schema this rule requires. This rule is evaluated at the JSONPath `$.tags` — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid APIs.json. Return only the complete corrected document, with no commentary.
ArtifactAPIs.json
Applies at (given)$.tags
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/apis-json/tag-apis-json-not-empty/