Plan Currency Iso4217

plan-currency-iso4217

info experience: consistencyexperience: data-modeling spec: document

currency should be an ISO 4217 code.

currency should be a 3-letter ISO 4217 code (e.g. USD).

Rule definition

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

plan-currency-iso4217:
  title: Plan Currency Iso4217
  reference: https://spotlight-rules.com/spec/rules/plans/plan-currency-iso4217/
  description: currency should be a 3-letter ISO 4217 code (e.g. USD).
  message: currency should be an ISO 4217 code.
  given: $.currency
  severity: info
  then:
    function: pattern
    functionOptions:
      match: ^[A-Z]{3}$
  tags:
    - format:plans
    - spec:document
    - experience:consistency
    - experience:data-modeling
  prompt: "You are editing a Plans document to satisfy the Spotlight API
    governance rule 'plan-currency-iso4217' (Plan Currency Iso4217).
    Requirement: currency should be a 3-letter ISO 4217 code (e.g. USD). To fix:
    Ensure the targeted value matches the regular expression `^[A-Z]{3}$`;
    rewrite any value that does not. This rule is evaluated at the JSONPath
    `$.currency` — 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 Plans. 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 a Plans document to satisfy the Spotlight API governance rule 'plan-currency-iso4217' (Plan Currency Iso4217). Requirement: currency should be a 3-letter ISO 4217 code (e.g. USD). To fix: Ensure the targeted value matches the regular expression `^[A-Z]{3}$`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.currency` — 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 Plans. Return only the complete corrected document, with no commentary.
ArtifactPlans
Applies at (given)$.currency
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/plans/plan-currency-iso4217/