AgStack Foundation · API Governance Rules
AgStack Foundation API Rules
Spectral linting rules defining API design standards and conventions for AgStack Foundation.
25 Rules
error 7
warn 17
info 1
Rule Categories
agstack
error
no
path
query
schema
security
servers
Rules
warn
agstack-operation-summary-title-case
Operation summaries should use Title Case
$.paths[*][*].summary
error
agstack-operationid-defined
All operations must define an operationId
$.paths[*][get,post,put,delete,patch]
error
agstack-response-200-defined
All operations must define a successful response
$.paths[*][*].responses
warn
agstack-response-422-validation-error
FastAPI operations should document 422 validation errors
$.paths[*][get,post].responses
warn
agstack-security-bearer-defined
Protected operations must declare Bearer security
$.paths[*][post,put,delete,patch]
error
agstack-info-version
API must define a version
$.info
warn
agstack-info-description
API must include a description
$.info
error
agstack-server-url-defined
API must define at least one server URL
$.servers
warn
agstack-schema-type-defined
Schema components must define a type
$.components.schemas[*]
warn
agstack-request-body-content-type
POST/PUT request bodies should specify application/json content type
$.paths[*][post,put].requestBody.content
warn
agstack-tags-on-operations
All operations should have tags for grouping
$.paths[*][*]
warn
agstack-geo-id-format
Geo ID fields should follow AgStack's 16-character alphanumeric format
$.components.schemas[*].properties.geo_id
error
agstack-openapi-version-3
API must use OpenAPI 3.x
$.openapi
warn
agstack-description-field-length
Operation descriptions should be meaningful (min 10 chars)
$.paths[*][*].description
error
agstack-geojson-type-field
GeoJSON schemas must include a type field
$.components.schemas.GeoJSONOut.properties
warn
agstack-paths-lowercase
API paths should use lowercase and hyphens
$.paths
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the agstack.org 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
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 camelCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
security-schemes-defined
Security schemes should be defined in components.
$.components
warn
error-schema-defined
A shared error schema (HTTPValidationError) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description