Spectral linting rules defining API design standards and conventions for Weave Net.
27 Ruleserror 8warn 13info 6
Generated by API Evangelist
Written by API Evangelist tooling for Weave Net's APIs. It is a starting point, not a ruleset Weave Net publishes or enforces.
# 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
# weave-net — 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-expected-domain: 1/1 servers on 0.1
# - path-params-casing: camel @ 62% (n=13)
# - operationid-casing: camel @ 100% (n=13)
# - schema-names-casing: pascal @ 100% (n=7)
# - schema-properties-casing: snake @ 100% (n=21)
# - merge: kept 22 existing, added 5 measured, upgraded 0
# - added: servers-expected-domain, path-params-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
- spectral:oas
rules:
info-title-required:
description: Info must have a title
severity: error
given: $.info
then:
field: title
function: truthy
info-description-required:
description: Info must have a description
severity: warn
given: $.info
then:
field: description
function: truthy
info-version-required:
description: Info must have a version
severity: error
given: $.info
then:
field: version
function: truthy
info-contact-recommended:
description: Info should have contact information
severity: info
given: $.info
then:
field: contact
function: truthy
info-license-required:
description: Info should have license information
severity: warn
given: $.info
then:
field: license
function: truthy
openapi-version-3:
description: Must use OpenAPI 3.x
severity: error
given: $
then:
field: openapi
function: pattern
functionOptions:
match: ^3\.
servers-required:
description: Servers must be defined
severity: error
given: $
then:
field: servers
function: truthy
servers-description-required:
description: Server entries should have descriptions
severity: info
given: $.servers[*]
then:
field: description
function: truthy
operation-operationId-required:
description: Every operation must have an operationId
severity: error
given: $.paths[*][get,post,put,delete,patch]
then:
field: operationId
function: truthy
operation-operationId-camel-case:
description: OperationIds must use camelCase
severity: warn
given: $.paths[*][get,post,put,delete,patch].operationId
then:
function: pattern
functionOptions:
match: ^[a-z][a-zA-Z0-9]*$
operation-summary-required:
description: Every operation must have a summary
severity: warn
given: $.paths[*][get,post,put,delete,patch]
then:
field: summary
function: truthy
operation-summary-weave-net-prefix:
description: Operation summaries must start with 'Weave Net'
severity: info
given: $.paths[*][get,post,put,delete,patch].summary
then:
function: pattern
functionOptions:
match: ^Weave Net
operation-description-required:
description: Operations should have descriptions
severity: warn
given: $.paths[*][get,post,put,delete,patch]
then:
field: description
function: truthy
operation-tags-required:
description: Operations must have at least one tag
severity: warn
given: $.paths[*][get,post,put,delete,patch]
then:
field: tags
function: truthy
parameter-description-required:
description: Parameters should have descriptions
severity: warn
given: $.paths[*][get,post,put,delete,patch].parameters[*]
then:
field: description
function: truthy
parameter-schema-required:
description: Parameters 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 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
severity: warn
given: $.paths[*][get,post,put,delete,patch].responses[*]
then:
field: description
function: truthy
get-no-request-body:
description: GET operations must not have a request body
severity: error
given: $.paths[*].get
then:
field: requestBody
function: falsy
delete-returns-correct-status:
description: DELETE operations should return 204 or 200
severity: info
given: $.paths[*].delete.responses
then:
function: schema
functionOptions:
schema:
anyOf:
- required:
- '204'
- required:
- '200'
schema-properties-described:
description: Schema properties should have descriptions
severity: info
given: $.components.schemas[*].properties[*]
then:
field: description
function: truthy
operation-microcks-extension:
description: Operations should have x-microcks-operation for mock support
severity: info
given: $.paths[*][get,post,put,delete,patch]
then:
field: x-microcks-operation
function: truthy
servers-expected-domain:
description: Server URLs should be on the 0.1 domain.
severity: warn
given: $.servers[*].url
then:
function: pattern
functionOptions:
match: 0\.1
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
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: warn
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
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.