Chick-fil-A · API Governance Rules

Chick-fil-A API Rules

Spectral linting rules defining API design standards and conventions for Chick-fil-A.

37 Rules error 5 warn 21 info 11
View Rules File View on GitHub

Rule Categories

get global info no openapi operation parameter paths query request response schema server servers tag

Rules

warn
info-title-prefix
API title should start with "Chick-fil-A".
$.info.title
warn
info-description-required
Info object must have a description of reasonable length.
$.info
error
info-version-required
Info object must declare a version.
$.info
info
info-contact-required
Info object should declare a contact.
$.info
warn
openapi-version-3
Specifications must use OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
warn
server-https
Server URLs should use HTTPS.
$.servers[*].url
info
server-description
Each server should have a description.
$.servers[*]
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
error
paths-no-query-string
Paths must not contain query strings.
$.paths[*]~
info
paths-lower-case
Path segments should be lower camelCase or kebab-case (no UPPER snake).
$.paths[*]~
error
operation-operationId-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelcase-verb
operationId should be camelCase and begin with a verb (get/list/add/run/create/update/delete).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries should be prefixed with "Chick-fil-A".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation should have a description.
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Each operation should carry an x-microcks-operation extension for mock compatibility.
$.paths[*][get,post,put,patch,delete]
info
global-tags-defined
A global tags array should be defined.
$
info
tag-description
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tag names should be Title Case (single capitalized words like "Accounts", "Networking").
$.tags[*].name
warn
parameter-description-required
Every parameter must have a description.
$..parameters[*]
warn
parameter-schema-required
Every parameter must declare a schema with a type.
$..parameters[?(@.in)]
warn
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch].requestBody.content
info
request-body-description
Request bodies should have a description.
$.paths[*][post,put,patch].requestBody
warn
response-success-defined
Operations must define a 200 (or other 2xx) success response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
info
response-json-content
2xx responses should return application/json.
$.paths[*][get,post,put,patch,delete].responses.200.content
warn
schema-description-required
Top-level component schemas should have a description.
$.components.schemas[*]
info
schema-property-type
Schema properties should declare a type.
$.components.schemas[*].properties[*]
info
schema-property-example
Scalar schema properties should include an example.
$.components.schemas[*].properties[?(@.type && @.type != 'object' && @.type != 'array')]
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
warn
servers-expected-domain
Server URLs should be on the example.com domain.
$.servers[*].url
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be PascalCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# chickfila — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 100% of servers already https (error)
#   - servers-expected-domain: 1/1 servers on example.com
#   - query-params-casing: snake @ 100% (n=36)
#   - operationid-casing: camel @ 100% (n=27)
#   - schema-names-casing: pascal @ 100% (n=31)
#   - schema-properties-casing: pascal @ 86% (n=69)
#   - merge: kept 32 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, query-params-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-prefix:
    description: API title should start with "Chick-fil-A".
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^Chick-fil-A
  info-description-required:
    description: Info object must have a description of reasonable length.
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: Info object must declare a version.
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  info-contact-required:
    description: Info object should declare a contact.
    severity: info
    given: $.info
    then:
      field: contact
      function: truthy
  openapi-version-3:
    description: Specifications must use OpenAPI 3.0.x.
    severity: warn
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-defined:
    description: At least one server must be defined.
    severity: error
    given: $.servers
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1
  server-https:
    description: Server URLs should use HTTPS.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  server-description:
    description: Each server should have a description.
    severity: info
    given: $.servers[*]
    then:
      field: description
      function: truthy
  paths-no-trailing-slash:
    description: Paths must not end with a trailing slash.
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: .+/$
  paths-no-query-string:
    description: Paths must not contain query strings.
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: \?
  paths-lower-case:
    description: Path segments should be lower camelCase or kebab-case (no UPPER snake).
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: '[A-Z]{2,}'
  operation-operationId-required:
    description: Every operation must declare an operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-operationId-camelcase-verb:
    description: operationId should be camelCase and begin with a verb (get/list/add/run/create/update/delete).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^(get|list|add|run|create|update|delete|getAll)[A-Z0-9].*$|^(get|list|add|run|create|update|delete)[A-Za-z0-9]*$
  operation-summary-required:
    description: Every operation must have a summary.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-summary-prefix:
    description: Operation summaries should be prefixed with "Chick-fil-A".
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: '^Chick-fil-A '
  operation-description-required:
    description: Every operation should have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  operation-tags-required:
    description: Every operation must declare at least one tag.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  operation-microcks-extension:
    description: Each operation should carry an x-microcks-operation extension for mock compatibility.
    severity: info
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: x-microcks-operation
      function: truthy
  global-tags-defined:
    description: A global tags array should be defined.
    severity: info
    given: $
    then:
      field: tags
      function: truthy
  tag-description:
    description: Each global tag should have a description.
    severity: info
    given: $.tags[*]
    then:
      field: description
      function: truthy
  tag-title-case:
    description: Tag names should be Title Case (single capitalized words like "Accounts", "Networking").
    severity: warn
    given: $.tags[*].name
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z]+$
  parameter-description-required:
    description: Every parameter must have a description.
    severity: warn
    given: $..parameters[*]
    then:
      field: description
      function: truthy
  parameter-schema-required:
    description: Every parameter must declare a schema with a type.
    severity: warn
    given: $..parameters[?(@.in)]
    then:
      field: schema
      function: truthy
  request-body-json:
    description: Request bodies should offer application/json content.
    severity: warn
    given: $.paths[*][post,put,patch].requestBody.content
    then:
      field: application/json
      function: truthy
  request-body-description:
    description: Request bodies should have a description.
    severity: info
    given: $.paths[*][post,put,patch].requestBody
    then:
      field: description
      function: truthy
  response-success-defined:
    description: Operations must define a 200 (or other 2xx) success response.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '200'
      function: truthy
  response-description-required:
    description: Every response must have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  response-json-content:
    description: 2xx responses should return application/json.
    severity: info
    given: $.paths[*][get,post,put,patch,delete].responses.200.content
    then:
      field: application/json
      function: truthy
  schema-description-required:
    description: Top-level component schemas should have a description.
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-property-type:
    description: Schema properties should declare a type.
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: type
      function: truthy
  schema-property-example:
    description: Scalar schema properties should include an example.
    severity: info
    given: $.components.schemas[*].properties[?(@.type && @.type != 'object' && @.type != 'array')]
    then:
      field: example
      function: truthy
  get-no-request-body:
    description: GET operations must not declare a request body.
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  servers-expected-domain:
    description: Server URLs should be on the example.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: example\.com
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be PascalCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z0-9]*$
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy