Plan Price Non Negative
plan-price-non-negative
info
experience: data-modeling
spec: plans
Plan price should be a non-negative number.
A plan price should be a non-negative number.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
plan-price-non-negative:
title: Plan Price Non Negative
reference: https://spotlight-rules.com/spec/rules/plans/plan-price-non-negative/
description: A plan price should be a non-negative number.
message: Plan price should be a non-negative number.
given: $.plans[*].price
severity: info
then:
function: schema
functionOptions:
schema:
type:
- number
- integer
minimum: 0
tags:
- format:plans
- spec:plans
- experience:data-modeling
prompt: "You are editing a Plans document to satisfy the Spotlight API
governance rule 'plan-price-non-negative' (Plan Price Non Negative).
Requirement: A plan price should be a non-negative number. To fix: Adjust
the targeted value so it conforms to the schema this rule requires. This
rule is evaluated at the JSONPath `$.plans[*].price` — 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-price-non-negative' (Plan Price Non Negative). Requirement: A plan price should be a non-negative number. To fix: Adjust the targeted value so it conforms to the schema this rule requires. This rule is evaluated at the JSONPath `$.plans[*].price` — 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.
| Artifact | Plans |
|---|---|
| Applies at (given) | $.plans[*].price |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/plans/plan-price-non-negative/ |