# 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
# lavu — 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-https-only: 100% of servers already https (error)
# - servers-expected-domain: 2/2 servers on poslavu.com
# - schema-names-casing: pascal @ 100% (n=11)
# - schema-properties-casing: snake @ 100% (n=224)
# - operation-security-required: 2/2 ops declare per-op security
# - merge: kept 31 existing, added 4 measured, upgraded 0
# - added: servers-expected-domain, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
- spectral:oas
rules:
info-title-required:
description: The API must declare a title.
severity: error
given: $.info
then:
field: title
function: truthy
info-title-lavu-prefix:
description: The API title should reference Lavu.
severity: warn
given: $.info.title
then:
function: pattern
functionOptions:
match: Lavu
info-description-required:
description: The API must have a meaningful description (min 40 chars).
severity: warn
given: $.info
then:
field: description
function: length
functionOptions:
min: 40
info-version-required:
description: The API must declare a version.
severity: error
given: $.info
then:
field: version
function: truthy
info-contact-required:
description: The API should declare a contact.
severity: warn
given: $.info
then:
field: contact
function: truthy
openapi-version-3:
description: Specs must use OpenAPI 3.0.x.
severity: warn
given: $.openapi
then:
function: pattern
functionOptions:
match: ^3\.0\.\d+$
servers-defined:
description: At least one server must be defined.
severity: error
given: $
then:
field: servers
function: truthy
servers-https:
description: Server URLs must use HTTPS (POSLavu request servers are HTTPS).
severity: warn
given: $.servers[*].url
then:
function: pattern
functionOptions:
match: ^https://
servers-description:
description: Each server should be described.
severity: info
given: $.servers[*]
then:
field: description
function: truthy
operation-operationid-required:
description: Every operation must declare an operationId.
severity: error
given: $.paths[*][get,post,put,patch,delete]
then:
field: operationId
function: truthy
operation-operationid-camel-case:
description: operationId must be camelCase (e.g. queryTable, insertRecords).
severity: warn
given: $.paths[*][get,post,put,patch,delete].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,patch,delete]
then:
field: summary
function: truthy
operation-summary-lavu-prefix:
description: Operation summaries must begin with the provider name "Lavu".
severity: warn
given: $.paths[*][get,post,put,patch,delete].summary
then:
function: pattern
functionOptions:
match: '^Lavu '
operation-description-required:
description: Every operation must have a description.
severity: warn
given: $.paths[*][get,post,put,patch,delete]
then:
field: description
function: truthy
operation-tags-required:
description: Every operation must declare at least one tag.
severity: warn
given: $.paths[*][get,post,put,patch,delete]
then:
field: tags
function: truthy
operation-microcks-extension:
description: Each operation should carry an x-microcks-operation extension for mocking.
severity: info
given: $.paths[*][get,post,put,patch,delete]
then:
field: x-microcks-operation
function: truthy
tags-defined:
description: A global tags array should be defined.
severity: info
given: $
then:
field: tags
function: truthy
tag-description-required:
description: Each global tag should have a description.
severity: info
given: $.tags[*]
then:
field: description
function: truthy
tag-title-case:
description: Tag names must be Title Case (e.g. Menu, Orders, Inventory).
severity: warn
given: $.tags[*].name
then:
function: pattern
functionOptions:
match: ^[A-Z][A-Za-z]+( [A-Z][A-Za-z]+)*$
request-body-form-encoded:
description: POSLavu accepts form-encoded request bodies; operations should expose an application/x-www-form-urlencoded
media type.
severity: warn
given: $.paths[*][post,put,patch].requestBody.content
then:
field: application/x-www-form-urlencoded
function: truthy
request-body-schema:
description: Request body media types must declare a schema.
severity: warn
given: $.paths[*][post,put,patch].requestBody.content[*]
then:
field: schema
function: truthy
response-2xx-required:
description: Every operation must define a 2xx success response.
severity: warn
given: $.paths[*][get,post,put,patch,delete].responses
then:
field: '200'
function: truthy
response-description-required:
description: Every response must have a description.
severity: warn
given: $.paths[*][get,post,put,patch,delete].responses[*]
then:
field: description
function: truthy
response-xml-content:
description: POSLavu returns XML; responses should expose an application/xml media type.
severity: info
given: $.paths[*][get,post,put,patch,delete].responses[*].content
then:
field: application/xml
function: truthy
schema-property-snake-case:
description: Schema property names must be snake_case to match POSLavu table columns (acronym columns
such as UPC are exempt).
severity: warn
given: $.components.schemas[*].properties.*~
then:
function: pattern
functionOptions:
match: ^[a-z][a-z0-9_]*$|^[A-Z]+$
schema-property-type:
description: Every schema property must declare a type or a $ref.
severity: warn
given: $.components.schemas[*].properties[*]
then:
function: schema
functionOptions:
schema:
anyOf:
- required:
- type
- required:
- $ref
schema-property-description:
description: Schema properties should carry a description.
severity: info
given: $.components.schemas[*].properties[*]
then:
field: description
function: truthy
schema-table-enum:
description: The table selector should be constrained to the documented POSLavu tables via an enum.
severity: info
given: $.components.schemas.QueryRequest.properties.table
then:
field: enum
function: truthy
security-scheme-defined:
description: At least one security scheme must be defined.
severity: warn
given: $.components.securitySchemes
then:
function: truthy
security-scheme-described:
description: Each security scheme should be described.
severity: info
given: $.components.securitySchemes[*]
then:
field: description
function: truthy
operation-security-required:
description: Every operation should declare its security requirements (dataname/key/token).
severity: info
given: $.paths[*][get,post,put,patch,delete]
then:
field: security
function: truthy
servers-expected-domain:
description: Server URLs should be on the poslavu.com domain.
severity: warn
given: $.servers[*].url
then:
function: pattern
functionOptions:
match: poslavu\.com
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: casing
functionOptions:
type: pascal
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
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
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. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.