Amazon Private CA · API Governance Rules

Amazon Private CA API Rules

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

24 Rules error 12 warn 10 info 2
View Rules File View on GitHub

Rule Categories

info no openapi operation operationid parameter query response schema security servers

Rules

error
info-title-required
API must have a title
$.info
error
info-description-required
API must have a description
$.info
error
info-version-required
API version must be defined
$.info
error
openapi-version-3
API should use OpenAPI 3.x
$.openapi
error
servers-defined
Servers must be defined
$
error
operation-summary-required
All operations must have a summary
$.paths[*][post,get,put,delete,patch]
warn
operation-summary-amazon-private-ca-prefix
Summaries should start with Amazon Private CA
$.paths[*][post,get,put,delete,patch].summary
error
operation-description-required
All operations must have a description
$.paths[*][post,get,put,delete,patch]
error
operation-id-required
All operations must have an operationId
$.paths[*][post,get,put,delete,patch]
warn
operation-tags-required
All operations must have tags
$.paths[*][post,get,put,delete,patch]
error
parameter-description-required
All parameters must have descriptions
$.paths[*][*].parameters[*]
error
response-success-required
All operations must have a success response
$.paths[*][post,get,put,delete,patch]
error
response-description-required
All responses must have descriptions
$.paths[*][*].responses[*]
warn
schema-type-defined
Schemas should define a type
$.components.schemas[*]
info
schema-description-required
Schemas should have descriptions
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined
$.components
warn
security-global-defined
Global security must be defined
$
warn
no-empty-descriptions
Descriptions must not be empty
$..description
info
operation-examples-encouraged
Consider adding examples to operation responses
$.paths[*][*].responses[*].content[*]
warn
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
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

Spectral Ruleset

Raw ↑
# amazon-private-ca — 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)
#   - query-params-casing: pascal @ 100% (n=6)
#   - operationid-casing: pascal @ 100% (n=23)
#   - schema-names-casing: pascal @ 100% (n=146)
#   - schema-properties-casing: pascal @ 100% (n=181)
#   - security: global (root) — NOT emitting operation-security-required
#   - merge: kept 19 existing, added 5 measured, upgraded 0
#   - added: servers-https-only, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-required:
    description: API must have a title
    message: Info object must have a title
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-description-required:
    description: API must have a description
    message: Info object must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API version must be defined
    message: Info object must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: API should use OpenAPI 3.x
    severity: error
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.
  servers-defined:
    description: Servers must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  operation-summary-required:
    description: All operations must have a summary
    severity: error
    given: $.paths[*][post,get,put,delete,patch]
    then:
      field: summary
      function: truthy
  operation-summary-amazon-private-ca-prefix:
    description: Summaries should start with Amazon Private CA
    message: Operation summary should start with 'Amazon Private CA'
    severity: warn
    given: $.paths[*][post,get,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Private CA
  operation-description-required:
    description: All operations must have a description
    severity: error
    given: $.paths[*][post,get,put,delete,patch]
    then:
      field: description
      function: truthy
  operation-id-required:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][post,get,put,delete,patch]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: All operations must have tags
    severity: warn
    given: $.paths[*][post,get,put,delete,patch]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: All parameters must have descriptions
    severity: error
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    description: All operations must have a success response
    severity: error
    given: $.paths[*][post,get,put,delete,patch]
    then:
      field: responses
      function: truthy
  response-description-required:
    description: All responses must have descriptions
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  schema-type-defined:
    description: Schemas should define a type
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  schema-description-required:
    description: Schemas should have descriptions
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  security-global-defined:
    description: Global security must be defined
    severity: warn
    given: $
    then:
      field: security
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: warn
    given: $..description
    then:
      function: truthy
  operation-examples-encouraged:
    description: Consider adding examples to operation responses
    severity: info
    given: $.paths[*][*].responses[*].content[*]
    then:
      field: examples
      function: truthy
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  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]*$