U.S. Treasury Fiscal Data · API Governance Rules
U.S. Treasury Fiscal Data API Rules
Spectral linting rules defining API design standards and conventions for U.S. Treasury Fiscal Data.
31 Rules
error 6
warn 13
info 12
Rule Categories
treasury
Rules
error
treasury-info-title-present
API must have a title in the info object.
$.info
warn
treasury-info-description-present
API must have a description in the info object.
$.info
error
treasury-info-version-present
API must have a version in the info object.
$.info
warn
treasury-info-contact-present
API info should include contact information.
$.info
error
treasury-operation-id-present
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
treasury-operation-summary-present
All operations must have a summary.
$.paths[*][get,post,put,patch,delete]
info
treasury-operation-description-present
All operations should have a description.
$.paths[*][get,post,put,patch,delete]
warn
treasury-operation-tags-present
All operations should have tags.
$.paths[*][get,post,put,patch,delete]
warn
treasury-operation-id-pascal-case
OperationId should use camelCase naming convention.
$.paths[*][get,post,put,patch,delete].operationId
warn
treasury-parameter-description-present
All parameters should have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
info
treasury-query-parameter-style
Query parameters should follow Treasury API naming conventions.
$.paths[*].get.parameters[?(@.in=="query")].name
error
treasury-response-200-present
All GET operations must have a 200 response.
$.paths[*].get
warn
treasury-response-400-present
Operations should define a 400 error response.
$.paths[*][get,post,put,patch,delete]
warn
treasury-response-description-present
All responses should have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
warn
treasury-response-schema-present
Successful responses should reference a schema.
$.paths[*][get,post].responses['200'].content['application/json']
info
treasury-schema-description-present
All schemas in components should have a description.
$.components.schemas[*]
warn
treasury-schema-properties-present
Object schemas should define properties.
$.components.schemas[?(@.type=="object")]
info
treasury-property-description-present
Schema properties should have descriptions.
$.components.schemas[*].properties[*]
warn
treasury-property-type-present
Schema properties should declare a type.
$.components.schemas[*].properties[*]
info
treasury-pagination-fields-param
Treasury fiscal endpoints should support fields parameter for field selection.
$.paths[*].get.parameters
info
treasury-pagination-filter-param
Treasury fiscal endpoints should support filter parameter for data filtering.
$.paths[*].get.parameters
info
treasury-response-data-envelope
Successful responses should use the standard data envelope with meta and links.
$.components.schemas[?(@.properties.data && @.properties.meta && @.properties.links)]
warn
treasury-tags-defined
All tags used in operations must be defined at the top level.
$.tags
info
treasury-tag-description-present
All top-level tags should have descriptions.
$.tags[*]
error
treasury-servers-present
API must define at least one server.
$
error
treasury-server-url-https
Server URLs should use HTTPS.
$.servers[*].url
info
treasury-server-description-present
Servers should have descriptions.
$.servers[*]
info
treasury-components-schemas-present
API should define reusable schemas in components.
$.components
info
treasury-components-parameters-present
API should define reusable parameters in components.
$.components
warn
treasury-path-version-prefix
Treasury Fiscal Data API paths should include a version prefix (v1, v2, etc.).
$.paths[*]~
info
treasury-path-lowercase
Path segments should be lowercase with underscores.
$.paths[*]~