API Baseurl HTTPS
api-baseurl-https
info
experience: security
spec: apis
API baseURL should use https.
Each API baseURL should be an https URL.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
api-baseurl-https:
title: API Baseurl HTTPS
reference: https://spotlight-rules.com/spec/rules/apis-json/api-baseurl-https/
description: Each API baseURL should be an https URL.
message: API baseURL should use https.
given: $.apis[*].baseURL
severity: info
then:
function: pattern
functionOptions:
match: ^https://
tags:
- format:apis-json
- spec:apis
- experience:security
prompt: "You are editing an APIs.json document to satisfy the Spotlight API
governance rule 'api-baseurl-https' (API Baseurl HTTPS). Requirement: Each
API baseURL should be an https URL. To fix: Ensure the targeted value
matches the regular expression `^https://`; rewrite any value that does not.
This rule is evaluated at the JSONPath `$.apis[*].baseURL` — 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-baseurl-https' (API Baseurl HTTPS). Requirement: Each API baseURL should be an https URL. To fix: Ensure the targeted value matches the regular expression `^https://`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.apis[*].baseURL` — 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) | $.apis[*].baseURL |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/apis-json/api-baseurl-https/ |