Kraken · API Governance Rules
Kraken API Rules
Spectral linting rules defining API design standards and conventions for Kraken.
35 Rules
error 15
warn 17
info 3
Rule Categories
delete
get
info
openapi
operation
parameter
paths
request
response
schema
security
servers
tag
Rules
error
info-title-kraken-prefix
API title must start with "Kraken".
$.info.title
warn
info-description-required
info.description must be present and at least 60 characters.
$.info
warn
info-contact-required
info.contact with name and url is required.
$.info.contact
warn
info-license-required
info.license must reference Kraken Terms of Service.
$.info.license
error
info-version-required
info.version is required.
$.info
error
openapi-3-0-required
Kraken specs must use OpenAPI 3.0.x.
$.openapi
error
servers-required
At least one server URL must be defined.
$.servers
error
servers-https-only
REST server URLs must use https.
$.servers[*].url
warn
servers-description-required
Every server must include a description.
$.servers[*]
error
paths-no-trailing-slash
Paths must not end with a trailing slash (other than root).
$.paths.*~
error
paths-no-query-string
Paths must not embed query strings.
$.paths.*~
warn
paths-spot-rest-prefix
Spot REST paths must start with /0/public/ or /0/private/.
$.paths.*~
error
operation-operationId-required
Every operation must declare an operationId.
$.paths.*[get,post,put,delete,patch]
error
operation-operationId-camelcase
operationId must be camelCase.
$.paths.*[get,post,put,delete,patch].operationId
error
operation-summary-required
Every operation must have a summary.
$.paths.*[get,post,put,delete,patch]
warn
operation-summary-kraken-prefix
Operation summary must begin with "Kraken ".
$.paths.*[get,post,put,delete,patch].summary
warn
operation-description-required
Every operation must have a description.
$.paths.*[get,post,put,delete,patch]
error
operation-tags-required
Every operation must be tagged.
$.paths.*[get,post,put,delete,patch]
info
operation-microcks-extension
Operations should declare x-microcks-operation for mock-server compatibility.
$.paths.*[get,post,put,delete,patch]
warn
tag-global-required
Global tags array must be defined with descriptions.
$.tags
warn
tag-description-required
Every tag must have a description.
$.tags[*]
warn
tag-title-case
Tag names must be Title Case (e.g. "Market Data", "Trading").
$.tags[*].name
warn
parameter-description-required
Every parameter must have a description.
$.paths.*[get,post,put,delete,patch].parameters[*]
error
parameter-schema-type-required
Every parameter must declare a schema.type.
$.paths.*[get,post,put,delete,patch].parameters[*].schema
warn
request-body-form-or-json
Kraken Spot REST requests must use application/x-www-form-urlencoded or application/json.
$.paths.*[post,put,patch].requestBody.content
info
request-nonce-required
Private request schemas should reference the nonced base (NoncedRequest) so a nonce field is always present.
$.paths.*[post].requestBody.content['application/x-www-form-urlencoded'].schema
error
response-2xx-required
Every operation must define at least one 2xx response.
$.paths.*[get,post,put,delete,patch].responses
warn
response-application-json
200 responses must include an application/json media type.
$.paths.*[get,post,put,delete,patch].responses['200'].content
info
response-envelope-shape
Spot REST 200 responses should resolve to the {error, result} envelope (BaseEnvelope allOf).
$.paths.*[get,post].responses['200'].content['application/json'].schema
warn
schema-property-snake-case
Schema property names must be snake_case (matches Kraken REST wire format).
$.components.schemas[*].properties
warn
schema-type-required
Every schema must declare a type or use allOf/oneOf/$ref.
$.components.schemas[*]
error
security-schemes-defined
Specs must declare at least one security scheme.
$.components.securitySchemes
warn
security-scheme-kraken-signature
Spot REST must declare the kraken_signature API key security scheme.
$.components.securitySchemes
error
get-no-request-body
GET operations must not declare a requestBody.
$.paths.*[get]
warn
delete-no-request-body
DELETE operations must not declare a requestBody.
$.paths.*[delete]