Rockwell Collins · API Governance Rules

Rockwell Collins API Rules

Spectral linting rules defining API design standards and conventions for Rockwell Collins.

11 Rules error 5 warn 5 info 1
View Rules File View on GitHub

Rule Categories

aeroapi

Rules

error
aeroapi-has-security
All AeroAPI operations must define security with ApiKeyAuth
$.paths[*][get,post,put,patch,delete]
error
aeroapi-operation-id-required
All AeroAPI operations must have a unique operationId
$.paths[*][get,post,put,patch,delete]
warn
aeroapi-operation-id-snake-case
AeroAPI operationIds use snake_case naming
$.paths[*][get,post,put,patch,delete].operationId
error
aeroapi-summary-required
All AeroAPI operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
aeroapi-summary-title-case
Operation summaries must use Title Case
$.paths[*][get,post,put,patch,delete].summary
warn
aeroapi-operation-description-required
AeroAPI operations should include detailed descriptions
$.paths[*][get,post,put,patch,delete]
warn
aeroapi-valid-tag
Operation tags must use AeroAPI defined categories
$.paths[*][get,post,put,patch,delete].tags[*]
info
aeroapi-pagination-cursor
List operations should support cursor-based pagination
$.paths[*][get]
warn
aeroapi-path-format
AeroAPI paths use lowercase with forward slashes
$.paths[*]~
error
aeroapi-success-response-schema
Successful responses must include a schema
$.paths[*][get,post,put,patch,delete].responses['200']
error
aeroapi-info-version
API info must include version
$.info

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:

  # FlightAware AeroAPI uses x-apikey header authentication
  aeroapi-has-security:
    description: All AeroAPI operations must define security with ApiKeyAuth
    message: "Operation must include the ApiKeyAuth security scheme (x-apikey header)"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: security
      function: defined

  # Operations must have operationIds
  aeroapi-operation-id-required:
    description: All AeroAPI operations must have a unique operationId
    message: "Operation is missing an operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  # OperationIds use snake_case (AeroAPI convention)
  aeroapi-operation-id-snake-case:
    description: AeroAPI operationIds use snake_case naming
    message: "OperationId '{{value}}' should use snake_case format"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9_]*$"

  # Summaries must exist and use Title Case
  aeroapi-summary-required:
    description: All AeroAPI operations must have a summary
    message: "Operation is missing a summary"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  aeroapi-summary-title-case:
    description: Operation summaries must use Title Case
    message: "Summary '{{value}}' should use Title Case"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  # Operations must have descriptions
  aeroapi-operation-description-required:
    description: AeroAPI operations should include detailed descriptions
    message: "Operation is missing a description - AeroAPI documentation standard requires detailed descriptions"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

  # Tags must be one of the defined AeroAPI categories
  aeroapi-valid-tag:
    description: Operation tags must use AeroAPI defined categories
    message: "Tag must be one of: flights, foresight, airports, operators, alerts, history, miscellaneous"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].tags[*]"
    then:
      function: enumeration
      functionOptions:
        values:
          - flights
          - foresight
          - airports
          - operators
          - alerts
          - history
          - miscellaneous

  # Pagination parameters: max_pages and cursor are standard
  aeroapi-pagination-cursor:
    description: List operations should support cursor-based pagination
    message: "List operations should include cursor pagination parameter"
    severity: info
    given: "$.paths[*][get]"
    then:
      function: defined

  # Path format: all lowercase with slashes
  aeroapi-path-format:
    description: AeroAPI paths use lowercase with forward slashes
    message: "Path must use lowercase letters and forward slashes"
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-z0-9{}_/-]+)+$"

  # 200 responses should have content schemas
  aeroapi-success-response-schema:
    description: Successful responses must include a schema
    message: "200 response should include content with schema"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses['200']"
    then:
      field: content
      function: truthy

  # API info must be complete
  aeroapi-info-version:
    description: API info must include version
    message: "API must define a version number"
    severity: error
    given: "$.info"
    then:
      field: version
      function: truthy