Weather.gov · API Governance Rules

Weather.gov API Rules

Spectral linting rules defining API design standards and conventions for Weather.gov.

29 Rules error 8 warn 16 info 5
Generated by API Evangelist Written by API Evangelist tooling for Weather.gov's APIs. It is a starting point, not a ruleset Weather.gov publishes or enforces.
View Rules File View on GitHub

Rule Categories

contact delete external get info no openapi operation parameter path paths query response schema security servers

Rules

error
info-title-required
Info must have a title
$.info
warn
info-description-required
Info must have a description
$.info
error
info-version-required
Info must have a version
$.info
error
openapi-version-3
Must use OpenAPI 3.x
$
error
servers-required
Servers array must be defined
$
warn
servers-https-only
All server URLs must use HTTPS
$.servers[*].url
warn
paths-kebab-case
Path segments must use kebab-case
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths[*]~
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
operation-operationId-snake-case
OperationId must use snake_case
$.paths[*][get,post,put,delete,patch].operationId
warn
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,delete,patch]
warn
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,delete,patch].parameters[*]
error
parameter-schema-required
Every parameter must have a schema
$.paths[*][get,post,put,delete,patch].parameters[*]
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,delete,patch].responses
warn
response-description-required
Every response must have a description
$.paths[*][get,post,put,delete,patch].responses[*]
warn
schema-type-required
Schema properties must define a type
$.components.schemas[*]
info
schema-description-recommended
Schemas should have descriptions
$.components.schemas[*]
warn
security-schemes-defined
Security schemes must be defined in components
$.components.securitySchemes
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body
$.paths[*].delete
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
contact-info-recommended
Info should have contact details
$.info
info
external-docs-recommended
Spec should have external documentation link
$
warn
servers-expected-domain
Server URLs should be on the weather.gov domain.
$.servers[*].url
info
path-params-casing
Path parameters should be snake_case (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

Spectral Ruleset

Raw ↑
# authorship: generated by API Evangelist tooling. Stamped 2026-08-18
# on the file's own generator header (roadmap#64). An unmarked file is
# NOT assumed to be ours -- absence of evidence was never stamped.
x-method: generated
# weather-gov — 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 weather.gov
#   - path-params-casing: snake @ 52% (n=82)
#   - query-params-casing: snake @ 94% (n=89)
#   - operationid-casing: snake @ 94% (n=65)
#   - schema-names-casing: pascal @ 100% (n=108)
#   - schema-properties-casing: snake @ 47% (n=421)
#   - security: global (root) — NOT emitting operation-security-required
#   - pagination params observed: ['cursor', 'limit']
#   - merge: kept 24 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-required:
    description: Info must have a title
    message: OpenAPI spec must have a title in info
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-description-required:
    description: Info must have a description
    message: OpenAPI spec must have a description in info
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: Info must have a version
    message: OpenAPI spec must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: Must use OpenAPI 3.x
    message: Spec must use OpenAPI 3.0.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-required:
    description: Servers array must be defined
    message: Spec must define servers
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https-only:
    description: All server URLs must use HTTPS
    message: Server URL must use HTTPS
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  paths-kebab-case:
    description: Path segments must use kebab-case
    message: 'Path segments must be kebab-case: {{value}}'
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(\/[a-z0-9{}_,\-\/]*)*$
  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    message: 'Path must not end with a trailing slash: {{value}}'
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: \/$
  operation-operationId-required:
    description: Every operation must have an operationId
    message: Operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  operation-operationId-snake-case:
    description: OperationId must use snake_case
    message: 'OperationId must use snake_case: {{value}}'
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9_]*$
  operation-description-required:
    description: Every operation must have a description
    message: Operation must have a description
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: description
      function: truthy
  operation-tags-required:
    description: Every operation must have tags
    message: Operation must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: Every parameter must have a description
    message: Parameter must have a description
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].parameters[*]
    then:
      field: description
      function: truthy
  parameter-schema-required:
    description: Every parameter must have a schema
    message: Parameter must have a schema
    severity: error
    given: $.paths[*][get,post,put,delete,patch].parameters[*]
    then:
      field: schema
      function: truthy
  response-success-required:
    description: Every operation must have a 2xx success response
    message: Operation must define at least one 2xx success response
    severity: error
    given: $.paths[*][get,post,put,delete,patch].responses
    then:
      function: schema
      functionOptions:
        schema:
          minProperties: 1
  response-description-required:
    description: Every response must have a description
    message: Response must have a description
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].responses[*]
    then:
      field: description
      function: truthy
  schema-type-required:
    description: Schema properties must define a type
    message: Schema must have a type defined
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  schema-description-recommended:
    description: Schemas should have descriptions
    message: Schema should have a description
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined in components
    message: API must define security schemes
    severity: warn
    given: $.components.securitySchemes
    then:
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body
    message: GET operation must not have a requestBody
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  delete-no-request-body:
    description: DELETE operations should not have a request body
    message: DELETE operation should not have a requestBody
    severity: warn
    given: $.paths[*].delete
    then:
      field: requestBody
      function: falsy
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    message: Description must not be empty
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  contact-info-recommended:
    description: Info should have contact details
    message: Info should include contact information
    severity: info
    given: $.info
    then:
      field: contact
      function: truthy
  external-docs-recommended:
    description: Spec should have external documentation link
    message: Spec should include externalDocs
    severity: info
    given: $
    then:
      field: externalDocs
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the weather.gov domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: weather\.gov
  path-params-casing:
    description: Path parameters should be snake_case (the dominant convention in this API).
    severity: info
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: snake
  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

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/weather-gov-spectral-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.