Schema Asyncapi Property Camel Case
schema-asyncapi-property-camel-case
info
experience: namingexperience: consistency
spec: components
Schema property is not camelCase.
Schema property names should be camelCase.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
schema-asyncapi-property-camel-case:
title: Schema Asyncapi Property Camel Case
reference: https://spotlight-rules.com/spec/rules/asyncapi/schema-asyncapi-property-camel-case/
description: Schema property names should be camelCase.
message: Schema property is not camelCase.
given: $.components.schemas[*].properties[*]~
severity: info
then:
function: pattern
functionOptions:
match: ^[a-z][a-zA-Z0-9]*$
tags:
- format:asyncapi
- spec:components
- experience:naming
- experience:consistency
prompt: "You are editing an AsyncAPI document to satisfy the Spotlight API
governance rule 'schema-asyncapi-property-camel-case' (Schema Asyncapi
Property Camel Case). Requirement: Schema property names should be
camelCase. To fix: Ensure the targeted value matches the regular expression
`^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is
evaluated at the JSONPath `$.components.schemas[*].properties[*]~` — 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
AsyncAPI. 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 AsyncAPI document to satisfy the Spotlight API governance rule 'schema-asyncapi-property-camel-case' (Schema Asyncapi Property Camel Case). Requirement: Schema property names should be camelCase. To fix: Ensure the targeted value matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.components.schemas[*].properties[*]~` — 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 AsyncAPI. Return only the complete corrected document, with no commentary.
| Artifact | AsyncAPI |
|---|---|
| Applies at (given) | $.components.schemas[*].properties[*]~ |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/asyncapi/schema-asyncapi-property-camel-case/ |