Lavu · API Governance Rules
Lavu API Rules
Spectral linting rules defining API design standards and conventions for Lavu.
31 Rules
error 4
warn 18
info 9
Rule Categories
info
openapi
operation
request
response
schema
security
servers
tag
tags
Rules
error
info-title-required
The API must declare a title.
$.info
warn
info-title-lavu-prefix
The API title should reference Lavu.
$.info.title
warn
info-description-required
The API must have a meaningful description (min 40 chars).
$.info
error
info-version-required
The API must declare a version.
$.info
warn
info-contact-required
The API should declare a contact.
$.info
warn
openapi-version-3
Specs must use OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$
warn
servers-https
Server URLs must use HTTPS (POSLavu request servers are HTTPS).
$.servers[*].url
info
servers-description
Each server should be described.
$.servers[*]
error
operation-operationid-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camel-case
operationId must be camelCase (e.g. queryTable, insertRecords).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-lavu-prefix
Operation summaries must begin with the provider name "Lavu".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Each operation should carry an x-microcks-operation extension for mocking.
$.paths[*][get,post,put,patch,delete]
info
tags-defined
A global tags array should be defined.
$
info
tag-description-required
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tag names must be Title Case (e.g. Menu, Orders, Inventory).
$.tags[*].name
warn
request-body-form-encoded
POSLavu accepts form-encoded request bodies; operations should expose an application/x-www-form-urlencoded media type.
$.paths[*][post,put,patch].requestBody.content
warn
request-body-schema
Request body media types must declare a schema.
$.paths[*][post,put,patch].requestBody.content[*]
warn
response-2xx-required
Every operation must define a 2xx success response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
info
response-xml-content
POSLavu returns XML; responses should expose an application/xml media type.
$.paths[*][get,post,put,patch,delete].responses[*].content
warn
schema-property-snake-case
Schema property names must be snake_case to match POSLavu table columns (acronym columns such as UPC are exempt).
$.components.schemas[*].properties.*~
warn
schema-property-type
Every schema property must declare a type or a $ref.
$.components.schemas[*].properties[*]
info
schema-property-description
Schema properties should carry a description.
$.components.schemas[*].properties[*]
info
schema-table-enum
The table selector should be constrained to the documented POSLavu tables via an enum.
$.components.schemas.QueryRequest.properties.table
warn
security-scheme-defined
At least one security scheme must be defined.
$.components.securitySchemes
info
security-scheme-described
Each security scheme should be described.
$.components.securitySchemes[*]
info
operation-security-required
Every operation should declare its security requirements (dataname/key/token).
$.paths[*][get,post,put,patch,delete]