Genius · API Governance Rules
Genius API Rules
Spectral linting rules defining API design standards and conventions for Genius.
13 Rules
error 8
warn 4
info 1
Rule Categories
genius
Rules
error
genius-snake-case-paths
Path segments must use snake_case (e.g. /web_pages/lookup, /artists/{id}/songs).
$.paths.*~
error
genius-snake-case-query-params
Query and path parameter names must be snake_case (Genius uses per_page, text_format, raw_annotatable_url, etc.).
$.paths[*][*].parameters[?(@.in == 'query' || @.in == 'path')].name
error
genius-operation-id
Every operation must have an operationId in camelCase.
$.paths[*][get,post,put,delete,patch]
warn
genius-operation-summary-title-case
Operation summaries must be Title Case.
$.paths[*][*].summary
error
genius-operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,delete,patch]
warn
genius-operation-description
Every operation must have a description.
$.paths[*][get,post,put,delete,patch]
warn
genius-response-meta-envelope
All 2xx JSON responses must reference a schema that envelopes the payload under `meta` + `response`.
$.components.schemas[?(@property.match(/Response$/i))]
error
genius-meta-shape
The Meta envelope schema must include a numeric `status` field.
$.components.schemas.Meta
error
genius-security-defined
Genius uses OAuth2 and a bearer client access token. Both must be defined.
$.components.securitySchemes
error
genius-oauth2-scopes
The OAuth2 scheme must declare the four canonical Genius scopes.
$.components.securitySchemes.GeniusOAuth2.flows.authorizationCode.scopes
info
genius-pagination-params
Collection-listing operations should support `per_page` and `page`.
$.paths[?(@property.match(/\\/(songs|artists|albums|annotations|referents|comments|activity|albums|users|followers|leaderboard|tracks|edits|contributions)$/) || @property.match(/\\/(songs|artists|albums|referents|web_pages)$/))][get].parameters
warn
genius-text-format-enum
The `text_format` parameter must enumerate dom, html, markdown, plain.
$.paths[*][*].parameters[?(@.name == 'text_format')].schema
error
genius-numeric-id-paths
Path `{id}` parameters for resources (songs, artists, albums, annotations, users) must be integers.
$.paths[*][*].parameters[?(@.in == 'path' && @.name == 'id')].schema