API Contact Include Email
api-contact-include-email
info
experience: documentationexperience: discoverability
spec: apis
API contact COULD have email.
The contact object in an APIs.json file allows for referencing the email address of a person or group. This property provides a convenient way for users to seek support for an API, using email as the default method to reach the team managing the API in production.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
api-contact-include-email:
title: API Contact Include Email
reference: https://spotlight-rules.com/spec/rules/apis-json/api-contact-include-email/
description: The contact object in an APIs.json file allows for referencing the
email address of a person or group. This property provides a convenient way
for users to seek support for an API, using email as the default method to
reach the team managing the API in production.
message: API contact COULD have email.
severity: info
given: $.apis.*.contact.*
then:
field: email
function: truthy
tags:
- format:apis-json
- spec:apis
- experience:documentation
- experience:discoverability
prompt: "You are editing an APIs.json document to satisfy the Spotlight API
governance rule 'api-contact-include-email' (API Contact Include Email).
Requirement: The contact object in an APIs.json file allows for referencing
the email address of a person or group. This property provides a convenient
way for users to seek support for an API, using email as the default method
to reach the team managing the API in production. To fix: Ensure `email` is
present and non-empty at each matching location. This rule is evaluated at
the JSONPath `$.apis.*.contact.*` — 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-contact-include-email' (API Contact Include Email). Requirement: The contact object in an APIs.json file allows for referencing the email address of a person or group. This property provides a convenient way for users to seek support for an API, using email as the default method to reach the team managing the API in production. To fix: Ensure `email` is present and non-empty at each matching location. This rule is evaluated at the JSONPath `$.apis.*.contact.*` — 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.*.contact.* |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/apis-json/api-contact-include-email/ |