Alpha Vantage · API Governance Rules

Alpha Vantage API Rules

Spectral linting rules defining API design standards and conventions for Alpha Vantage.

20 Rules error 8 warn 11 info 1
View Rules File View on GitHub

Rule Categories

alpha error no query schema servers

Rules

warn
alpha-vantage-operation-summary-prefix
All operation summaries must start with "Alpha Vantage"
$.paths[*][*].summary
error
alpha-vantage-operation-tags
All operations must have at least one tag
$.paths[*][*]
error
alpha-vantage-operation-id
All operations must have an operationId
$.paths[*][*]
warn
alpha-vantage-operation-description
All operations must have a description
$.paths[*][*]
error
alpha-vantage-apikey-param
All operations must have the apikey parameter
$.paths[*][get].parameters[*]
error
alpha-vantage-function-param
All query operations must have the function parameter
$.paths[/query][get].parameters[?(@.name == 'function')]
warn
alpha-vantage-function-enum
The function parameter must have an enum of allowed values
$.paths[/query][get].parameters[?(@.name == 'function')].schema
error
alpha-vantage-apikey-security-scheme
API must define the ApiKey security scheme
$.components.securitySchemes
error
alpha-vantage-apikey-in-query
ApiKey must be passed as a query parameter
$.components.securitySchemes.ApiKey
warn
alpha-vantage-schema-title
All schemas must have a title
$.components.schemas[*]
warn
alpha-vantage-schema-description
All schemas must have a description
$.components.schemas[*]
warn
alpha-vantage-property-description
Schema properties should have descriptions
$.components.schemas[*].properties[*]
error
alpha-vantage-200-response
All operations must document a 200 success response
$.paths[*][*].responses
info
alpha-vantage-microcks-operation
All operations should have x-microcks-operation extension
$.paths[*][*]
error
alpha-vantage-server-https
API server must use HTTPS
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the alphavantage.co domain.
$.servers[*].url
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
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 ↑
# alpha-vantage — 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 alphavantage.co
#   - query-params-casing: snake @ 100% (n=13)
#   - schema-names-casing: pascal @ 100% (n=8)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - pagination params observed: ['limit']
#   - merge: kept 15 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, query-params-casing, schema-names-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  alpha-vantage-operation-summary-prefix:
    description: All operation summaries must start with "Alpha Vantage"
    severity: warn
    given: $.paths[*][*].summary
    then:
      function: pattern
      functionOptions:
        match: ^Alpha Vantage
  alpha-vantage-operation-tags:
    description: All operations must have at least one tag
    severity: error
    given: $.paths[*][*]
    then:
      field: tags
      function: truthy
  alpha-vantage-operation-id:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][*]
    then:
      field: operationId
      function: truthy
  alpha-vantage-operation-description:
    description: All operations must have a description
    severity: warn
    given: $.paths[*][*]
    then:
      field: description
      function: truthy
  alpha-vantage-apikey-param:
    description: All operations must have the apikey parameter
    severity: error
    given: $.paths[*][get].parameters[*]
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            name:
              type: string
  alpha-vantage-function-param:
    description: All query operations must have the function parameter
    severity: error
    given: $.paths[/query][get].parameters[?(@.name == 'function')]
    then:
      function: truthy
  alpha-vantage-function-enum:
    description: The function parameter must have an enum of allowed values
    severity: warn
    given: $.paths[/query][get].parameters[?(@.name == 'function')].schema
    then:
      field: enum
      function: truthy
  alpha-vantage-apikey-security-scheme:
    description: API must define the ApiKey security scheme
    severity: error
    given: $.components.securitySchemes
    then:
      field: ApiKey
      function: truthy
  alpha-vantage-apikey-in-query:
    description: ApiKey must be passed as a query parameter
    severity: error
    given: $.components.securitySchemes.ApiKey
    then:
      field: in
      function: enumeration
      functionOptions:
        values:
        - query
  alpha-vantage-schema-title:
    description: All schemas must have a title
    severity: warn
    given: $.components.schemas[*]
    then:
      field: title
      function: truthy
  alpha-vantage-schema-description:
    description: All schemas must have a description
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  alpha-vantage-property-description:
    description: Schema properties should have descriptions
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  alpha-vantage-200-response:
    description: All operations must document a 200 success response
    severity: error
    given: $.paths[*][*].responses
    then:
      field: '200'
      function: truthy
  alpha-vantage-microcks-operation:
    description: All operations should have x-microcks-operation extension
    severity: info
    given: $.paths[*][*]
    then:
      field: x-microcks-operation
      function: truthy
  alpha-vantage-server-https:
    description: API server must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-expected-domain:
    description: Server URLs should be on the alphavantage.co domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: alphavantage\.co
  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: casing
      functionOptions:
        type: pascal
  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