Amazon CodeGuru Reviewer · API Governance Rules

Amazon CodeGuru Reviewer API Rules

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

16 Rules error 5 warn 10 info 1
View Rules File View on GitHub

Rule Categories

info no operation operationid path query response schema security servers

Rules

error
info-description-required
API must have a description
$.info
error
servers-https
All server URLs must use HTTPS
$.servers[*].url
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,delete,patch]
warn
operation-summary-company-prefix
Operation summaries should start with Amazon CodeGuru Reviewer
$.paths[*][get,post,put,delete,patch].summary
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,delete,patch]
error
response-description-required
Every response must have a description
$.paths[*][*].responses[*]
warn
schema-type-required
Schema components should have a type
$.components.schemas[*]
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
operation-microcks-operation
Operations should include x-microcks-operation
$.paths[*][get,post,put,delete,patch]
warn
path-params-casing
Path parameters should be PascalCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be PascalCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
operationid-casing
Operation IDs should be PascalCase (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
warn
schema-properties-casing
Schema properties should be PascalCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
security-schemes-defined
Security schemes should be defined in components.
$.components

Spectral Ruleset

Raw ↑
# amazon-codeguru-reviewer — 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: 50% of servers already https (warn)
#   - path-params-casing: pascal @ 67% (n=9)
#   - query-params-casing: pascal @ 95% (n=21)
#   - operationid-casing: pascal @ 100% (n=14)
#   - schema-names-casing: pascal @ 100% (n=128)
#   - schema-properties-casing: pascal @ 100% (n=145)
#   - security: global (root) — NOT emitting operation-security-required
#   - merge: kept 10 existing, added 6 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, security-schemes-defined
extends:
  - spectral:oas
rules:
  info-description-required:
    description: API must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  servers-https:
    description: All server URLs must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: truthy
  operation-summary-company-prefix:
    description: Operation summaries should start with Amazon CodeGuru Reviewer
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon CodeGuru Reviewer
  operation-operationId-required:
    description: Every operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: Every operation must have tags
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy
  response-description-required:
    description: Every response must have a description
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  schema-type-required:
    description: Schema components should have a type
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  operation-microcks-operation:
    description: Operations should include x-microcks-operation
    severity: info
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: x-microcks-operation
      function: truthy
  path-params-casing:
    description: Path parameters should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: pascal
  query-params-casing:
    description: Query parameters should be PascalCase (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: pascal
  operationid-casing:
    description: Operation IDs should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: pascal
  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: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z0-9]*$
  schema-properties-casing:
    description: Schema properties should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z0-9]*$
  security-schemes-defined:
    description: Security schemes should be defined in components.
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy