AmTrust Financial Services · API Governance Rules

AmTrust Financial Services API Rules

Spectral linting rules defining API design standards and conventions for AmTrust Financial Services.

17 Rules error 7 warn 10
View Rules File View on GitHub

Rule Categories

error info no operation operationid parameter path response schema security servers

Rules

warn
info-title-amtrust
API title must include AmTrust Financial Services
$.info.title
error
info-description-required
Info must have a description
$.info
error
servers-https-only
All servers must use HTTPS
$.servers[*].url
error
operation-summary-required
All operations must have summaries
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
All operations must have operationIds
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
All operations must have tags
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
All parameters must have descriptions
$.paths[*][*].parameters[*]
error
response-success-required
All operations must have success responses
$.paths[*][get,post,put,patch,delete].responses
error
security-schemes-defined
Security schemes must be defined
$.components
warn
schema-properties-typed
Schema properties should have explicit types
$.components.schemas[*].properties[*]
warn
servers-expected-domain
Server URLs should be on the amtrustservices.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be snake_case (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
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
warn
schema-properties-casing
Schema properties should be snake_case (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
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# amtrust-financial-services — 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 amtrustservices.com
#   - path-params-casing: snake @ 100% (n=3)
#   - operationid-casing: camel @ 100% (n=7)
#   - schema-names-casing: pascal @ 100% (n=12)
#   - schema-properties-casing: snake @ 100% (n=60)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - pagination params observed: ['limit', 'page']
#   - merge: kept 10 existing, added 7 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-amtrust:
    description: API title must include AmTrust Financial Services
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^AmTrust
  info-description-required:
    description: Info must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  servers-https-only:
    description: All servers must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  operation-summary-required:
    description: All operations must have summaries
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-operationid-required:
    description: All operations must have operationIds
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: All operations must have tags
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: All parameters must have descriptions
    severity: warn
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    description: All operations must have success responses
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '204'
  security-schemes-defined:
    description: Security schemes must be defined
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  schema-properties-typed:
    description: Schema properties should have explicit types
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      field: type
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the amtrustservices.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: amtrustservices\.com
  path-params-casing:
    description: Path parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      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 snake_case (the dominant convention in this API).
    severity: warn
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  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
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy