oasCamelCaseProperties
oasCamelCaseProperties
examines all schemas in an OpenAPI 3.x specification to identify property names that don’t
follow camelCase
convention. The function checks each schema property to ensure it starts with a lowercase letter
and contains only letters and numbers without underscores, hyphens, or other special characters.
The function iterates through all schemas in the document ensuring no schema is checked twice through caching mechanisms.
For each property that violates camelCase rules, the function identifies the specific case type being used
(snake_case
, PascalCase
, kebab-case
, etc.) and reports the violation with a descriptive message.
Example ruleset configuration
camel-case-properties:
description: "Schema property names should use camelCase format"
type: "style"
recommended: true
severity: "warn"
given: "$"
resolved: true
then:
function: "oasCamelCaseProperties"
The function is used by the camel-case-properties Rule