Archrock · API Governance Rules

Archrock API Rules

Spectral linting rules defining API design standards and conventions for Archrock.

19 Rules error 8 warn 10 info 1
View Rules File View on GitHub

Rule Categories

archrock no operationid query schema servers

Rules

error
archrock-quarterly-year-required
Quarterly financials must include year
$.components.schemas.QuarterlyFinancials.properties
error
archrock-fleet-utilization-rate
Fleet statistics must include utilization rate
$.components.schemas.FleetStatistics.properties
error
archrock-equipment-status-enum
Equipment status must be a valid enum value
$.components.schemas.Equipment.properties.status
error
archrock-sec-filing-type-enum
SEC filing type must be a valid enum value
$.components.schemas.SecFiling.properties.type
warn
archrock-list-responses-have-total
List responses must include a total count
$.components.schemas[*List].properties
warn
archrock-list-responses-have-limit
List responses must include a limit field
$.components.schemas[*List].properties
warn
archrock-operations-have-tags
All API operations must have tags
$.paths[*][get,post,put,patch,delete]
error
archrock-operations-have-summary
All API operations must have a summary
$.paths[*][get,post,put,patch,delete]
error
archrock-operations-have-operation-id
All API operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
archrock-api-key-security
API must use API key security scheme
$.components.securitySchemes
warn
archrock-info-contact-required
API info must include contact information
$.info
error
archrock-servers-defined
API must define at least one server
$
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the archrock.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
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
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 camelCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# archrock — 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 archrock.com
#   - query-params-casing: snake @ 100% (n=13)
#   - operationid-casing: camel @ 100% (n=5)
#   - schema-names-casing: pascal @ 100% (n=7)
#   - schema-properties-casing: camel @ 57% (n=54)
#   - security: global (root) — NOT emitting operation-security-required
#   - pagination params observed: ['limit', 'offset']
#   - merge: kept 12 existing, added 7 measured, upgraded 0
#   - added: servers-https-only, servers-expected-domain, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  archrock-quarterly-year-required:
    description: Quarterly financials must include year
    message: QuarterlyFinancials must have a year property
    severity: error
    given: $.components.schemas.QuarterlyFinancials.properties
    then:
      field: year
      function: truthy
  archrock-fleet-utilization-rate:
    description: Fleet statistics must include utilization rate
    message: FleetStatistics must have a utilizationRate property
    severity: error
    given: $.components.schemas.FleetStatistics.properties
    then:
      field: utilizationRate
      function: truthy
  archrock-equipment-status-enum:
    description: Equipment status must be a valid enum value
    message: Equipment status must be active, idle, or maintenance
    severity: error
    given: $.components.schemas.Equipment.properties.status
    then:
      field: enum
      function: truthy
  archrock-sec-filing-type-enum:
    description: SEC filing type must be a valid enum value
    message: SecFiling type must be a valid SEC form type
    severity: error
    given: $.components.schemas.SecFiling.properties.type
    then:
      field: enum
      function: truthy
  archrock-list-responses-have-total:
    description: List responses must include a total count
    message: List schema must include a total property
    severity: warn
    given: $.components.schemas[*List].properties
    then:
      field: total
      function: truthy
  archrock-list-responses-have-limit:
    description: List responses must include a limit field
    message: List schema must include a limit property
    severity: warn
    given: $.components.schemas[*List].properties
    then:
      field: limit
      function: truthy
  archrock-operations-have-tags:
    description: All API operations must have tags
    message: Operation must include at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  archrock-operations-have-summary:
    description: All API operations must have a summary
    message: Operation must include a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  archrock-operations-have-operation-id:
    description: All API operations must have an operationId
    message: Operation must include an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  archrock-api-key-security:
    description: API must use API key security scheme
    message: API should define an ApiKey security scheme
    severity: warn
    given: $.components.securitySchemes
    then:
      field: ApiKeyAuth
      function: truthy
  archrock-info-contact-required:
    description: API info must include contact information
    message: Info object must have a contact field
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  archrock-servers-defined:
    description: API must define at least one server
    message: Servers array must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-expected-domain:
    description: Server URLs should be on the archrock.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: archrock\.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
  operationid-casing:
    description: Operation IDs should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  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 camelCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy