API Tag Require Upper Case

api-tag-require-upper-case

info experience: namingexperience: consistencyexperience: discoverability spec: apisspec: tags

API Tags MUST Be Upper Case

Maintaining consistent casing for tags applied to individual APIs ensures a uniform appearance and enhances search and discovery. Each word in a tag should be capitalized, with the first letter of every word in a phrase treated the same way.

Rule definition

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

api-tag-require-upper-case:
  title: API Tag Require Upper Case
  reference: https://spotlight-rules.com/spec/rules/apis-json/api-tag-require-upper-case/
  description: Maintaining consistent casing for tags applied to individual APIs
    ensures a uniform appearance and enhances search and discovery. Each word in
    a tag should be capitalized, with the first letter of every word in a phrase
    treated the same way.
  message: API Tags MUST Be Upper Case
  severity: info
  given: $.apis.*.tags.*
  then:
    function: pattern
    functionOptions:
      match: "[A-Z]\\w*"
  tags:
    - format:apis-json
    - spec:apis
    - spec:tags
    - experience:naming
    - experience:consistency
    - experience:discoverability
  prompt: "You are editing an APIs.json document to satisfy the Spotlight API
    governance rule 'api-tag-require-upper-case' (API Tag Require Upper Case).
    Requirement: Maintaining consistent casing for tags applied to individual
    APIs ensures a uniform appearance and enhances search and discovery. Each
    word in a tag should be capitalized, with the first letter of every word in
    a phrase treated the same way. To fix: Ensure the targeted value matches the
    regular expression `[A-Z]\\w*`; rewrite any value that does not. This rule
    is evaluated at the JSONPath `$.apis.*.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 'api-tag-require-upper-case' (API Tag Require Upper Case). Requirement: Maintaining consistent casing for tags applied to individual APIs ensures a uniform appearance and enhances search and discovery. Each word in a tag should be capitalized, with the first letter of every word in a phrase treated the same way. To fix: Ensure the targeted value matches the regular expression `[A-Z]\w*`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.apis.*.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)$.apis.*.tags.*
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/apis-json/api-tag-require-upper-case/