Swell · API Governance Rules
Swell API Rules
Spectral linting rules defining API design standards and conventions for Swell.
7 Rules
error 3
warn 3
info 1
Rule Categories
swell
Rules
error
swell-operation-tag-required
Every operation MUST have at least one tag.
$.paths.*[get,post,put,patch,delete]
error
swell-operation-id-camel
operationId MUST be lowerCamelCase.
$.paths.*[get,post,put,patch,delete].operationId
warn
swell-summary-title-case
Operation summaries MUST be in Title Case.
$.paths.*[get,post,put,patch,delete].summary
warn
swell-resource-id-pattern
Path parameter ids should be 24-char hex ObjectIds.
$.paths..parameters[?(@.name=='id' && @.in=='path')].schema.pattern
warn
swell-money-fields-number
Money fields MUST be type number.
$.components.schemas.*.properties[grand_total,sub_total,tax_total,shipment_total,discount_total,price,sale_price,amount,balance,recurring_total].type
info
swell-list-responses-pagination
List responses SHOULD include count, page, results.
$.components.schemas[?(@property.match(/List$/))].properties
error
swell-security-required
Every operation MUST require security.
$.paths.*[get,post,put,patch,delete]