Amazon FreeRTOS · API Governance Rules

Amazon FreeRTOS API Rules

Spectral linting rules defining API design standards and conventions for Amazon FreeRTOS.

35 Rules error 7 warn 25 info 3
View Rules File View on GitHub

Rule Categories

error freertos no operation path query schema security servers

Rules

warn
freertos-info-contact
API must include contact information
$.info
error
freertos-info-description
API must have a description
$.info
error
freertos-server-https
Server URLs must use HTTPS
$.servers[*].url
error
freertos-operation-summary
Operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
freertos-operation-description
Operations should have a description
$.paths[*][get,post,put,patch,delete]
error
freertos-operation-tags
Operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
error
freertos-operation-id
Operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
freertos-operation-id-camel-case
operationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
freertos-response-200
POST operations should define 200 response
$.paths[*][post]
warn
freertos-response-400
Operations should define 400 response
$.paths[*][get,post,put,patch,delete]
warn
freertos-response-500
Operations should define 500 response
$.paths[*][get,post,put,patch,delete]
warn
freertos-response-404
Resource-by-ID operations should define 404
$.paths[*~'\{[^}]+\}'][get,put,patch,delete].responses
info
freertos-delete-204
DELETE operations should return 204
$.paths[*].delete
error
freertos-parameter-description
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
freertos-path-param-required
Path parameters must be required
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='path')]
warn
freertos-schema-description
Schema components should have descriptions
$.components.schemas[*]
warn
freertos-tags-title-case
Operation tags should use Title Case
$.paths[*][*].tags[*]
warn
freertos-ota-targets-required
OTA update schema must require targets
$.components.schemas.OtaUpdate.required
warn
freertos-ota-status-enum
OTA update status should define enum values
$.components.schemas.OtaUpdate.properties.otaUpdateStatus
warn
freertos-sw-config-hardware-platform
Software configuration must document hardware platform
$.components.schemas.SoftwareConfiguration.required
warn
freertos-create-prefix
POST creation operationIds should start with 'create'
$.paths[*].post.operationId
warn
freertos-list-prefix
Collection GET operationIds should start with 'list'
$.paths[*~'[^}]$'].get.operationId
warn
freertos-schema-properties
Object schemas should define properties
$.components.schemas[?(@.type=='object')]
warn
freertos-request-body-json
POST/PUT request bodies should define application/json
$.paths[*][post,put].requestBody.content
info
freertos-ota-protocols-documented
OTA update create request should document protocols
$.components.schemas.CreateOtaUpdateRequest.properties
warn
servers-expected-domain
Server URLs should be on the amazonaws.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be camelCase (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 snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
security-schemes-defined
Security schemes should be defined in components.
$.components
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas
warn
operation-documents-400
Operations should document a 400 response (documented on 100% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
operation-documents-500
Operations should document a 500 response (documented on 100% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# amazon-freertos — 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 amazonaws.com
#   - path-params-casing: camel @ 100% (n=7)
#   - query-params-casing: camel @ 100% (n=7)
#   - operationid-casing: camel @ 100% (n=11)
#   - schema-names-casing: pascal @ 100% (n=9)
#   - schema-properties-casing: snake @ 51% (n=45)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - operation-documents-400: 100% adherence
#   - operation-documents-500: 100% adherence
#   - pagination params observed: ['maxResults', 'nextToken']
#   - merge: kept 25 existing, added 10 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, security-schemes-defined, error-schema-defined, operation-documents-400, operation-documents-500, no-empty-descriptions
extends:
  - spectral:oas
rules:
  freertos-info-contact:
    description: API must include contact information
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  freertos-info-description:
    description: API must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  freertos-server-https:
    description: Server URLs must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  freertos-operation-summary:
    description: Operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  freertos-operation-description:
    description: Operations should have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  freertos-operation-tags:
    description: Operations must have at least one tag
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  freertos-operation-id:
    description: Operations must have operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  freertos-operation-id-camel-case:
    description: operationId should use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  freertos-response-200:
    description: POST operations should define 200 response
    severity: warn
    given: $.paths[*][post]
    then:
      field: responses.200
      function: truthy
  freertos-response-400:
    description: Operations should define 400 response
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: responses.400
      function: truthy
  freertos-response-500:
    description: Operations should define 500 response
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: responses.500
      function: truthy
  freertos-response-404:
    description: Resource-by-ID operations should define 404
    severity: warn
    given: $.paths[*~'\{[^}]+\}'][get,put,patch,delete].responses
    then:
      field: '404'
      function: truthy
  freertos-delete-204:
    description: DELETE operations should return 204
    severity: info
    given: $.paths[*].delete
    then:
      field: responses.204
      function: truthy
  freertos-parameter-description:
    description: Parameters must have descriptions
    severity: error
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  freertos-path-param-required:
    description: Path parameters must be required
    severity: error
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='path')]
    then:
      field: required
      function: truthy
  freertos-schema-description:
    description: Schema components should have descriptions
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  freertos-tags-title-case:
    description: Operation tags should use Title Case
    severity: warn
    given: $.paths[*][*].tags[*]
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9 ]*$
  freertos-ota-targets-required:
    description: OTA update schema must require targets
    severity: warn
    given: $.components.schemas.OtaUpdate.required
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            const: targets
  freertos-ota-status-enum:
    description: OTA update status should define enum values
    severity: warn
    given: $.components.schemas.OtaUpdate.properties.otaUpdateStatus
    then:
      field: enum
      function: truthy
  freertos-sw-config-hardware-platform:
    description: Software configuration must document hardware platform
    severity: warn
    given: $.components.schemas.SoftwareConfiguration.required
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            const: hardwarePlatform
  freertos-create-prefix:
    description: POST creation operationIds should start with 'create'
    severity: warn
    given: $.paths[*].post.operationId
    then:
      function: pattern
      functionOptions:
        match: ^(create|list|tag|get|describe)
  freertos-list-prefix:
    description: Collection GET operationIds should start with 'list'
    severity: warn
    given: $.paths[*~'[^}]$'].get.operationId
    then:
      function: pattern
      functionOptions:
        match: ^list
  freertos-schema-properties:
    description: Object schemas should define properties
    severity: warn
    given: $.components.schemas[?(@.type=='object')]
    then:
      field: properties
      function: truthy
  freertos-request-body-json:
    description: POST/PUT request bodies should define application/json
    severity: warn
    given: $.paths[*][post,put].requestBody.content
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
          - application/json
  freertos-ota-protocols-documented:
    description: OTA update create request should document protocols
    severity: info
    given: $.components.schemas.CreateOtaUpdateRequest.properties
    then:
      field: protocols
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the amazonaws.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: amazonaws\.com
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  query-params-casing:
    description: Query parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: pattern
      functionOptions:
        match: ^[a-z][A-Za-z0-9]*$
  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 snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  security-schemes-defined:
    description: Security schemes should be defined in components.
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy
  operation-documents-400:
    description: Operations should document a 400 response (documented on 100% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '400'
      function: truthy
  operation-documents-500:
    description: Operations should document a 500 response (documented on 100% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '500'
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy