Tag Require Upper Case
tag-require-upper-case
info
experience: namingexperience: consistencyexperience: discoverability
spec: tags
Tags Upper Case
Maintaining consistent casing for tags applied to APIs.json contracts 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.
tag-require-upper-case:
title: Tag Require Upper Case
reference: https://spotlight-rules.com/spec/rules/apis-json/tag-require-upper-case/
description: Maintaining consistent casing for tags applied to APIs.json
contracts 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: Tags Upper Case
severity: info
given: $.tags.*
then:
function: pattern
functionOptions:
match: "[A-Z]\\w*"
tags:
- format:apis-json
- spec:tags
- experience:naming
- experience:consistency
- experience:discoverability
prompt: "You are editing an APIs.json document to satisfy the Spotlight API
governance rule 'tag-require-upper-case' (Tag Require Upper Case).
Requirement: Maintaining consistent casing for tags applied to APIs.json
contracts 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 `$.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-require-upper-case' (Tag Require Upper Case). Requirement: Maintaining consistent casing for tags applied to APIs.json contracts 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 `$.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.
| Artifact | APIs.json |
|---|---|
| Applies at (given) | $.tags.* |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/apis-json/tag-require-upper-case/ |