Amazon Audit Manager · API Governance Rules

Amazon Audit Manager API Rules

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

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

Rule Categories

audit no path query schema security servers

Rules

warn
audit-manager-operation-id-camel-case
All operationIds must be camelCase
$.paths[*][*].operationId
warn
audit-manager-summary-prefix
All operation summaries must start with Amazon Audit Manager
$.paths[*][*].summary
warn
audit-manager-has-tags
All operations must have tags
$.paths[*][*]
error
audit-manager-response-200
All operations must have a 200 response
$.paths[*][*].responses
error
audit-manager-assessment-name-required
CreateAssessmentRequest must require name
$.components.schemas.CreateAssessmentRequest
error
audit-manager-assessment-status-enum
AssessmentMetadata Status must use valid enum values
$.components.schemas.AssessmentMetadata.properties.status
error
audit-manager-assessment-report-status-enum
AssessmentReport status must use valid enum values
$.components.schemas.AssessmentReport.properties.status
error
audit-manager-framework-type-enum
Framework type must use valid enum values
$.components.schemas.Framework.properties.type
error
audit-manager-control-type-enum
Control type must use valid enum values
$.components.schemas.Control.properties.type
error
audit-manager-role-type-enum
Role roleType must use valid enum values
$.components.schemas.Role.properties.roleType
error
audit-manager-destination-type-enum
AssessmentReportsDestination type must use valid enum values
$.components.schemas.AssessmentReportsDestination.properties.destinationType
error
audit-manager-security-sigv4
API must use sigv4 security scheme
$.security[*]
warn
audit-manager-server-url-fixed
Server URL must be fixed without variables
$.servers[*]
warn
audit-manager-example-microcks-default
All examples must have x-microcks-default set to true
$.paths[*][*].responses[*].content[*].examples.default
error
audit-manager-delegation-status-enum
Delegation status must use valid enum values
$.components.schemas.Delegation.properties.status
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
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 camelCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
security-schemes-defined
Security schemes should be defined in components.
$.components
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# amazon-audit-manager — 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=15)
#   - query-params-casing: camel @ 88% (n=17)
#   - operationid-casing: camel @ 100% (n=22)
#   - schema-names-casing: pascal @ 100% (n=62)
#   - schema-properties-casing: camel @ 55% (n=265)
#   - security: global (root) — NOT emitting operation-security-required
#   - pagination params observed: ['maxResults', 'nextToken']
#   - merge: kept 15 existing, added 8 measured, upgraded 0
#   - added: servers-https-only, servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, security-schemes-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  audit-manager-operation-id-camel-case:
    description: All operationIds must be camelCase
    message: '{{property}} must be camelCase'
    severity: warn
    given: $.paths[*][*].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  audit-manager-summary-prefix:
    description: All operation summaries must start with Amazon Audit Manager
    message: Summary must start with Amazon Audit Manager
    severity: warn
    given: $.paths[*][*].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Audit Manager
  audit-manager-has-tags:
    description: All operations must have tags
    message: Operation must have at least one tag
    severity: warn
    given: $.paths[*][*]
    then:
      field: tags
      function: truthy
  audit-manager-response-200:
    description: All operations must have a 200 response
    message: Operation must define a 200 response
    severity: error
    given: $.paths[*][*].responses
    then:
      field: '200'
      function: truthy
  audit-manager-assessment-name-required:
    description: CreateAssessmentRequest must require name
    message: CreateAssessmentRequest must have name as required
    severity: error
    given: $.components.schemas.CreateAssessmentRequest
    then:
      field: required
      function: truthy
  audit-manager-assessment-status-enum:
    description: AssessmentMetadata Status must use valid enum values
    message: Status must be ACTIVE or INACTIVE
    severity: error
    given: $.components.schemas.AssessmentMetadata.properties.status
    then:
      field: enum
      function: truthy
  audit-manager-assessment-report-status-enum:
    description: AssessmentReport status must use valid enum values
    message: Status must be COMPLETE, IN_PROGRESS, or FAILED
    severity: error
    given: $.components.schemas.AssessmentReport.properties.status
    then:
      field: enum
      function: truthy
  audit-manager-framework-type-enum:
    description: Framework type must use valid enum values
    message: Framework type must be Standard or Custom
    severity: error
    given: $.components.schemas.Framework.properties.type
    then:
      field: enum
      function: truthy
  audit-manager-control-type-enum:
    description: Control type must use valid enum values
    message: Control type must be Standard or Custom
    severity: error
    given: $.components.schemas.Control.properties.type
    then:
      field: enum
      function: truthy
  audit-manager-role-type-enum:
    description: Role roleType must use valid enum values
    message: roleType must be PROCESS_OWNER or RESOURCE_OWNER
    severity: error
    given: $.components.schemas.Role.properties.roleType
    then:
      field: enum
      function: truthy
  audit-manager-destination-type-enum:
    description: AssessmentReportsDestination type must use valid enum values
    message: destinationType must be S3
    severity: error
    given: $.components.schemas.AssessmentReportsDestination.properties.destinationType
    then:
      field: enum
      function: truthy
  audit-manager-security-sigv4:
    description: API must use sigv4 security scheme
    message: Security must include sigv4
    severity: error
    given: $.security[*]
    then:
      field: sigv4
      function: defined
  audit-manager-server-url-fixed:
    description: Server URL must be fixed without variables
    message: Server URL must not use variables
    severity: warn
    given: $.servers[*]
    then:
      field: variables
      function: falsy
  audit-manager-example-microcks-default:
    description: All examples must have x-microcks-default set to true
    message: Example must have x-microcks-default true
    severity: warn
    given: $.paths[*][*].responses[*].content[*].examples.default
    then:
      field: x-microcks-default
      function: truthy
  audit-manager-delegation-status-enum:
    description: Delegation status must use valid enum values
    message: Delegation status must be IN_PROGRESS, UNDER_REVIEW, or COMPLETE
    severity: error
    given: $.components.schemas.Delegation.properties.status
    then:
      field: enum
      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 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: 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: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z0-9]*$
  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
  security-schemes-defined:
    description: Security schemes should be defined in components.
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy