activision-blizzard · API Governance Rules

activision-blizzard API Rules

Spectral linting rules defining API design standards and conventions for activision-blizzard.

28 Rules error 9 warn 16 info 3
View Rules File View on GitHub

Rule Categories

http info no openapi operation parameter path paths query response schema security servers

Rules

warn
info-title-format
API title should start with "Activision Blizzard" or "Battle.net"
$.info.title
error
info-description-required
Info object must have a description
$.info
error
info-version-required
Info object must include a version
$.info
warn
openapi-version
Should use OpenAPI 3.x
$.openapi
error
servers-defined
At least one server must be defined
$
warn
servers-https
All servers should use HTTPS
$.servers[*].url
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths[*]~
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summary should start with "Activision Blizzard"
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation should have a description
$.paths[*][get,post,put,patch,delete]
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelCase
OperationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-namespace-required
Battle.net data endpoints require namespace parameter
$.paths[/data/**][get].parameters
error
response-success-required
Every operation must have a 2xx response
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-defined
Operations should document 401 Unauthorized
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
error
security-schemes-defined
Security schemes must be defined in components
$.components
warn
security-oauth2
Battle.net API should use OAuth2 authentication
$.components.securitySchemes[*].type
error
http-get-no-request-body
GET operations should not have a request body
$.paths[*].get
warn
schema-description-required
Component schemas should have descriptions
$.components.schemas[*]
info
schema-property-examples
Schema properties should have example values
$.components.schemas[*].properties[*]
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 snake_case (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 snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# activision-blizzard — 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)
#   - path-params-casing: camel @ 89% (n=18)
#   - query-params-casing: snake @ 93% (n=27)
#   - operationid-casing: camel @ 100% (n=17)
#   - schema-names-casing: pascal @ 100% (n=17)
#   - schema-properties-casing: snake @ 82% (n=118)
#   - security: global (root) — NOT emitting operation-security-required
#   - pagination params observed: ['page', 'pageSize']
#   - merge: kept 23 existing, added 5 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-format:
    description: API title should start with "Activision Blizzard" or "Battle.net"
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^(Activision Blizzard|Battle\.net)
  info-description-required:
    description: Info object must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: Info object must include a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version:
    description: Should use OpenAPI 3.x
    severity: warn
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.
  servers-defined:
    description: At least one server must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https:
    description: All servers should use HTTPS
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: '[^/]/$'
  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-summary-prefix:
    description: Operation summary should start with "Activision Blizzard"
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: '^Activision Blizzard '
  operation-description-required:
    description: Every operation should have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  operation-operationId-required:
    description: Every operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-operationId-camelCase:
    description: OperationId should use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  operation-tags-required:
    description: Every operation must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: Every parameter must have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  parameter-namespace-required:
    description: Battle.net data endpoints require namespace parameter
    severity: info
    given: $.paths[/data/**][get].parameters
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              name:
                enum:
                - namespace
  response-success-required:
    description: Every operation must have a 2xx response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '204'
  response-401-defined:
    description: Operations should document 401 Unauthorized
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  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
  security-schemes-defined:
    description: Security schemes must be defined in components
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  security-oauth2:
    description: Battle.net API should use OAuth2 authentication
    severity: warn
    given: $.components.securitySchemes[*].type
    then:
      function: enumeration
      functionOptions:
        values:
        - oauth2
  http-get-no-request-body:
    description: GET operations should not have a request body
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  schema-description-required:
    description: Component schemas should have descriptions
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-property-examples:
    description: Schema properties should have example values
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: example
      function: truthy
  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 snake_case (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: snake
  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 snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy