Amazon Fargate · API Governance Rules

Amazon Fargate API Rules

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

33 Rules error 10 warn 18 info 5
View Rules File View on GitHub

Rule Categories

error info no openapi operation request response schema security servers tag tags

Rules

error
info-title-required
API must have a title in info
$.info
warn
info-title-amazon-fargate-prefix
API title must start with Amazon Fargate
$.info.title
error
info-description-required
API must have a description
$.info
error
info-version-required
API must have a version
$.info
warn
openapi-version-3-1
Must use OpenAPI 3.1.x
$
error
servers-required
Must define at least one server
$
error
servers-https-only
Server URLs must use HTTPS
$.servers[*].url
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-operationid-camelcase
operationId must use camelCase
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-summary-amazon-fargate-prefix
Operation summary must start with Amazon Fargate
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete,head,options]
warn
tags-defined
Global tags array must be defined
$
warn
tag-description-required
Each tag must have a description
$.tags[*]
warn
request-body-json-content-type
Request bodies should use application/x-amz-json-1.1 or application/json
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-error-400
Operations should have a 400 error response
$.paths[*][post,put,patch].responses
warn
response-error-500
Operations should document 500 server errors
$.paths[*][get,post,put,patch,delete].responses
warn
schema-description-required
Component schemas must have descriptions
$.components.schemas[*]
info
schema-property-description
Schema properties should have descriptions
$.components.schemas[*].properties[*]
warn
schema-type-defined
Schema properties must define a type
$.components.schemas[*].properties[*]
error
security-schemes-defined
Security schemes must be defined in components
$.components
warn
security-global-defined
Global security must be defined
$
info
security-aws-sig-v4
Should use AWS Signature V4 authentication
$.components.securitySchemes
info
operation-amz-json-content-type
Amazon API operations should use application/x-amz-json-1.1 content type
$.paths[*][post].requestBody.content
info
operation-microcks-extension
Operations should have x-microcks-operation extension for mock support
$.paths[*][get,post,put,patch,delete]
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
warn
servers-expected-domain
Server URLs should be on the amazonaws.com domain.
$.servers[*].url
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
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas

Spectral Ruleset

Raw ↑
# amazon-fargate — 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
#   - operationid-casing: camel @ 100% (n=21)
#   - schema-names-casing: pascal @ 100% (n=57)
#   - schema-properties-casing: camel @ 53% (n=205)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - operation-documents-400: 100% adherence
#   - operation-documents-500: 100% adherence
#   - merge: kept 29 existing, added 4 measured, upgraded 0
#   - added: servers-expected-domain, schema-names-casing, schema-properties-casing, error-schema-defined
extends:
  - spectral:oas
rules:
  info-title-required:
    description: API must have a title in info
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-title-amazon-fargate-prefix:
    description: API title must start with Amazon Fargate
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Fargate
  info-description-required:
    description: API must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3-1:
    description: Must use OpenAPI 3.1.x
    severity: warn
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.1\.
  servers-required:
    description: Must define at least one server
    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://
  operation-operationid-required:
    description: Every operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: operationId
      function: truthy
  operation-operationid-camelcase:
    description: operationId must use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: summary
      function: truthy
  operation-summary-amazon-fargate-prefix:
    description: Operation summary must start with Amazon Fargate
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Fargate
  operation-description-required:
    description: Every operation must have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: description
      function: truthy
  operation-tags-required:
    description: Every operation must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: tags
      function: truthy
  tags-defined:
    description: Global tags array must be defined
    severity: warn
    given: $
    then:
      field: tags
      function: truthy
  tag-description-required:
    description: Each tag must have a description
    severity: warn
    given: $.tags[*]
    then:
      field: description
      function: truthy
  request-body-json-content-type:
    description: Request bodies should use application/x-amz-json-1.1 or application/json
    severity: warn
    given: $.paths[*][post,put,patch].requestBody.content
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1
  response-success-required:
    description: Every operation must have a 2xx success response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1
  response-description-required:
    description: Every response must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  response-error-400:
    description: Operations should have a 400 error response
    severity: warn
    given: $.paths[*][post,put,patch].responses
    then:
      field: '400'
      function: truthy
  response-error-500:
    description: Operations should document 500 server errors
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '500'
      function: truthy
  schema-description-required:
    description: Component schemas must have descriptions
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-property-description:
    description: Schema properties should have descriptions
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  schema-type-defined:
    description: Schema properties must define a type
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      field: type
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined in components
    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
  security-aws-sig-v4:
    description: Should use AWS Signature V4 authentication
    severity: info
    given: $.components.securitySchemes
    then:
      field: aws_signature_v4
      function: truthy
  operation-amz-json-content-type:
    description: Amazon API operations should use application/x-amz-json-1.1 content type
    severity: info
    given: $.paths[*][post].requestBody.content
    then:
      function: truthy
  operation-microcks-extension:
    description: Operations should have x-microcks-operation extension for mock support
    severity: info
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: x-microcks-operation
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    severity: warn
    given: $..description
    then:
      function: truthy
  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
  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
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy