4chan · API Governance Rules
4chan API Rules
Spectral linting rules defining API design standards and conventions for 4chan.
45 Rules
error 14
warn 23
info 8
Rule Categories
external
get
info
no
openapi
operation
parameter
paths
response
schema
security
servers
tag
tags
Rules
warn
info-title-4chan-prefix
API title MUST begin with "4chan ".
$.info.title
warn
info-description-required
API description MUST be present and non-trivial.
$.info
error
info-version-required
API version MUST be declared in info.version.
$.info
warn
warn
info-terms-of-service-required
termsOfService MUST be set since 4chan publishes API ToS.
$.info
info
openapi-version-3-0-3
OpenAPI version SHOULD be 3.0.3.
$.openapi
error
servers-defined
At least one server entry MUST be present and reference a.4cdn.org.
$.servers
warn
servers-https-preferred
HTTPS server entry SHOULD be present first.
$.servers[0].url
warn
servers-description-required
Every server entry MUST have a description.
$.servers[*]
error
paths-no-trailing-slash
Paths MUST NOT end with a trailing slash.
$.paths.*~
warn
paths-must-end-in-json
4chan paths terminate in `.json` (or use a `{thread}.json` template).
$.paths.*~
error
paths-no-query-strings
Paths MUST NOT include a query string — the 4chan API does not accept GET parameters.
$.paths.*~
warn
paths-lowercase-segments
Path segments (other than `{params}`) MUST be lowercase.
$.paths.*~
error
operation-operationid-required
Every operation MUST declare an operationId.
$.paths.*[get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId MUST be camelCase, lead with `get`/`list`/`fetch`.
$.paths.*[get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation MUST have a summary.
$.paths.*[get,post,put,patch,delete]
warn
operation-summary-4chan-prefix
Operation summary SHOULD start with "4chan ".
$.paths.*[get,post,put,patch,delete].summary
warn
operation-description-required
Every operation MUST have a description (min 40 chars).
$.paths.*[get,post,put,patch,delete]
error
operation-tags-required
Every operation MUST declare at least one tag.
$.paths.*[get,post,put,patch,delete]
error
operation-only-get-allowed
Only GET operations are supported by the 4chan read-only JSON API.
$.paths.*
info
operation-microcks-extension-present
Each operation SHOULD declare `x-microcks-operation` for mock compatibility.
$.paths.*[get]
warn
tags-defined-globally
Global `tags` array MUST be defined.
$.tags
warn
tag-description-required
Every global tag MUST have a description.
$.tags[*]
info
tag-title-case
Tag names SHOULD use Title Case.
$.tags[*].name
warn
parameter-description-required
Every path parameter MUST have a description.
$.components.parameters[*]
error
parameter-schema-required
Every path parameter MUST declare a schema with a concrete type.
$.components.parameters[*]
info
parameter-example-required
Every path parameter SHOULD provide an example value.
$.components.parameters[*]
info
parameter-snake-case-names
Path parameter names SHOULD be short and lowercase.
$.components.parameters[*].name
error
response-200-required
Every operation MUST define a `200` response.
$.paths.*[get].responses
warn
response-304-recommended
GET operations SHOULD document the `304 Not Modified` response, since clients are required to use If-Modified-Since.
$.paths.*[get].responses
warn
response-404-required
GET operations MUST document `404 Not Found`.
$.paths.*[get].responses
warn
response-503-recommended
GET operations SHOULD document `503 Service Unavailable` (rate-limit back-pressure).
$.paths.*[get].responses
error
response-description-required
Every response MUST have a description.
$.paths.*[get].responses.*
error
response-json-content-type
2xx responses MUST use `application/json`.
$.paths.*[get].responses.200.content
info
response-200-example-required
200 responses SHOULD include a named example for Microcks mocking.
$.paths.*[get].responses.200.content.application/json
warn
schema-snake-case-properties
Schema property names MUST be snake_case (mirrors the actual 4chan JSON wire format).
$.components.schemas[*].properties.*~
warn
schema-description-required
Every top-level schema MUST have a description.
$.components.schemas[*]
error
schema-type-required
Every top-level schema MUST declare a type.
$.components.schemas[*]
warn
schema-properties-have-types
Every object property MUST declare a type (or be a $ref).
$.components.schemas[?(@.type=='object')].properties[?(!@.['$ref'])]
info
schema-properties-have-descriptions
Every object property SHOULD have a description.
$.components.schemas[?(@.type=='object')].properties[?(!@.['$ref'])]
warn
security-must-be-absent
The 4chan API is anonymous — `security` MUST NOT be declared.
$.security
warn
security-schemes-must-be-absent
No `securitySchemes` should be defined — there is no auth surface.
$.components.securitySchemes
error
get-no-request-body
GET operations MUST NOT define a request body.
$.paths.*[get]
warn
no-empty-descriptions
Descriptions MUST NOT be empty strings.
$..description
info
external-docs-encouraged
An `externalDocs` block linking to https://github.com/4chan/4chan-API is encouraged.
$