AniList · API Governance Rules
AniList API Rules
Spectral linting rules defining API design standards and conventions for AniList.
49 Rules
error 18
warn 22
info 9
Rule Categories
anilist
Rules
warn
anilist-info-title-prefix
API title should start with "AniList".
$.info.title
error
anilist-info-description-required
Info description is required and should describe the GraphQL surface.
$.info
warn
anilist-info-description-min-length
Info description should be at least 120 characters.
$.info.description
info
warn
anilist-info-license-required
License pointing to the AniList Terms of Use is required.
$.info
info
anilist-info-terms-of-service
termsOfService should reference docs.anilist.co.
$.info.termsOfService
error
anilist-openapi-version-3
Spec must declare OpenAPI 3.0.x.
$.openapi
error
anilist-servers-defined
At least one server must be defined.
$.servers
error
anilist-servers-https-only
All servers must use HTTPS.
$.servers[*].url
warn
anilist-servers-anilist-host
Server URLs must be on anilist.co or graphql.anilist.co.
$.servers[*].url
warn
anilist-servers-description
Each server entry should have a description.
$.servers[*]
error
anilist-paths-no-trailing-slash
Paths must not have a trailing slash (except the root "/").
$.paths[?(@property != "/")]~
warn
anilist-paths-oauth-prefix
OAuth2 paths must live under /api/v2/oauth.
$.paths
error
anilist-operation-id-required
Every operation must declare an operationId.
$.paths[*][get,put,post,delete,patch,options,head]
error
anilist-operation-id-camel-case
operationId must be camelCase.
$.paths[*][get,put,post,delete,patch,options,head].operationId
error
anilist-operation-summary-required
Every operation must have a summary.
$.paths[*][get,put,post,delete,patch,options,head]
warn
anilist-operation-summary-title-case
Summary should begin with an uppercase letter (Title Case).
$.paths[*][get,put,post,delete,patch,options,head].summary
warn
anilist-operation-description-required
Every operation must have a description.
$.paths[*][get,put,post,delete,patch,options,head]
warn
anilist-operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,put,post,delete,patch,options,head]
info
anilist-operation-microcks-extension
Operations should include x-microcks-operation for mock-server support.
$.paths[*][get,put,post,delete,patch,options,head]
warn
anilist-tags-defined
Spec must declare a top-level tags array.
$.tags
warn
anilist-tag-pascal-case
Tag names should be PascalCase (e.g. GraphQL, OAuth2).
$.tags[*].name
info
anilist-tag-description-required
Each tag should have a description.
$.tags[*]
warn
anilist-parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
error
anilist-parameter-oauth-snake-case
OAuth2 query parameters must be snake_case (client_id, redirect_uri, response_type).
$.paths[?(@property =~ /oauth/)][*].parameters[?(@.in == 'query')].name
error
anilist-parameter-schema-required
Every parameter must have a schema with a type.
$.paths[*][*].parameters[*]
warn
anilist-request-body-json
Request bodies should accept application/json (OAuth2 token endpoint may also accept form-encoded).
$.paths[*][post,put,patch].requestBody.content
info
anilist-request-body-example
Request bodies should include at least one named example.
$.paths[*][*].requestBody.content[*]
error
anilist-response-200-required
GraphQL POST / must document a 200 response.
$.paths['/'].post.responses
warn
anilist-response-429-required
GraphQL POST / must document a 429 response with rate-limit headers.
$.paths['/'].post.responses
info
anilist-response-403-documented
GraphQL POST / should document the 403 returned when the API is temporarily disabled.
$.paths['/'].post.responses
warn
anilist-response-rate-limit-headers
200 response on / should expose X-RateLimit-Limit and X-RateLimit-Remaining headers.
$.paths['/'].post.responses['200'].headers
warn
anilist-response-429-retry-headers
429 response should expose Retry-After and X-RateLimit-Reset headers.
$.paths['/'].post.responses['429'].headers
error
anilist-response-json-content-type
2xx and error responses on / must use application/json.
$.paths['/'].post.responses[*].content
warn
anilist-response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
error
anilist-schema-graphql-request-required
components.schemas must define GraphQLRequest, GraphQLResponse, and GraphQLError.
$.components.schemas
warn
anilist-schema-token-required
components.schemas must define TokenRequest and TokenResponse for OAuth2.
$.components.schemas
warn
anilist-schema-property-camel-or-snake
Schema properties should be camelCase or snake_case (matches AniList's GraphQL camelCase + OAuth snake_case mix).
$.components.schemas[*].properties[*]~
info
anilist-schema-title-required
Top-level component schemas should have a title.
$.components.schemas[*]
error
anilist-security-schemes-defined
securitySchemes must be defined.
$.components.securitySchemes
error
anilist-security-bearer-jwt
A bearerAuth scheme using JWT must be defined for authenticated mutations.
$.components.securitySchemes.bearerAuth
warn
anilist-security-oauth2-flows
An oauth2 security scheme with authorizationCode and implicit flows should be defined.
$.components.securitySchemes
warn
anilist-security-global
Spec must declare a global security stanza (including the public/empty option for the GraphQL endpoint).
$
error
anilist-graphql-post-only
The GraphQL endpoint must be exposed via POST only.
$.paths['/']
error
anilist-oauth-authorize-get
/api/v2/oauth/authorize must be a GET (browser redirect target).
$.paths['/api/v2/oauth/authorize']
error
anilist-oauth-token-post
/api/v2/oauth/token must be a POST.
$.paths['/api/v2/oauth/token']
warn
anilist-no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
anilist-deprecation-documented
Deprecated operations should explain the replacement in the description.
$.paths[*][?(@.deprecated == true)]
info
anilist-external-docs-encouraged
Operations should reference the AniList docs site under externalDocs.
$.paths[*][get,put,post,delete,patch,options,head]