Limit Max Positive

limit-max-positive

info experience: data-modelingexperience: reliability spec: limits

Limit max should be a positive integer.

A limit max should be a positive integer.

Rule definition

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

limit-max-positive:
  title: Limit Max Positive
  reference: https://spotlight-rules.com/spec/rules/rate-limits/limit-max-positive/
  description: A limit max should be a positive integer.
  message: Limit max should be a positive integer.
  given: $.limits[*].max
  severity: info
  then:
    function: schema
    functionOptions:
      schema:
        type: integer
        minimum: 1
  tags:
    - format:rate-limits
    - spec:limits
    - experience:data-modeling
    - experience:reliability
  prompt: "You are editing a Rate Limits document to satisfy the Spotlight API
    governance rule 'limit-max-positive' (Limit Max Positive). Requirement: A
    limit max should be a positive integer. To fix: Adjust the targeted value so
    it conforms to the schema this rule requires. This rule is evaluated at the
    JSONPath `$.limits[*].max` — 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 Rate Limits. 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 Rate Limits document to satisfy the Spotlight API governance rule 'limit-max-positive' (Limit Max Positive). Requirement: A limit max should be a positive integer. To fix: Adjust the targeted value so it conforms to the schema this rule requires. This rule is evaluated at the JSONPath `$.limits[*].max` — 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 Rate Limits. Return only the complete corrected document, with no commentary.
ArtifactRate Limits
Applies at (given)$.limits[*].max
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/rate-limits/limit-max-positive/