Hypixel · API Governance Rules

Hypixel API Rules

Spectral linting rules defining API design standards and conventions for Hypixel.

40 Rules error 16 warn 18 info 6
View Rules File View on GitHub

Rule Categories

examples global info microcks no openapi operation parameter paths query response schema security servers tags

Rules

error
info-title-hypixel-prefix
info.title MUST start with `Hypixel` so generated clients and docs are namespaced consistently.
$.info.title
error
info-description-required
info.description is required and must be substantive enough to render the docs landing page.
$.info.description
warn
info-version-v2
Hypixel Public API is on v2; pin the version field accordingly.
$.info.version
warn
info-contact-required
info.contact is required so consumers know where to ask API-help questions.
$.info
warn
info-terms-of-service-required
info.termsOfService must point at the Hypixel ToS (https://hypixel.net/tos).
$.info
error
openapi-version-3
Use OpenAPI 3.0.x for the Hypixel spec.
$.openapi
error
servers-required
A non-empty servers array is required so SDKs know the base URL.
$
error
servers-https-only
Hypixel only serves the API over HTTPS — no HTTP fallback.
$.servers[*].url
warn
servers-hypixel-host
The base server should be api.hypixel.net.
$.servers[*].url
error
paths-versioned
Every path must be prefixed with the API version (`/v2/`).
$.paths[*]~
warn
paths-lowercase
Path segments are lowercase across the Hypixel API.
$.paths[*]~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
error
paths-no-query-strings
Paths must not embed query strings — use the `parameters` array.
$.paths[*]~
error
operation-get-only
Hypixel is read-only — only GET operations are permitted.
$.paths[*]
error
operation-operationid-required
Every operation must declare an operationId so SDK generators have a stable handle.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId follows camelCase (e.g. `getPlayer`, `getSkyblockAuctions`).
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must declare a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-hypixel-prefix
Operation summaries must start with `Hypixel` for Naftiko/Microcks display consistency.
$.paths[*][get,post,put,patch,delete].summary
error
operation-tags-required
Every operation must declare at least one tag for grouping.
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation must declare a description (may match summary).
$.paths[*][get,post,put,patch,delete]
warn
tags-global-defined
Global tags must be declared at the spec level with descriptions.
$
warn
tags-allowed
Operations may only use the canonical Hypixel surface tags.
$.paths[*][get,post,put,patch,delete].tags[*]
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-camelcase
Query and path parameters use camelCase or snake_case (matching upstream naming).
$.paths[*][get,post,put,patch,delete].parameters[*].name
info
parameter-uuid-by-uuid
UUID-shaped player parameters should be named `uuid` for consistency with the Hypixel docs.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in == 'query' && @.schema && @.schema.format == 'uuid')].name
error
no-request-body
Hypixel is read-only; no operation should declare a requestBody.
$.paths[*][get,post,put,patch,delete]
error
response-200-required
Every operation must declare a 200 success response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-content-json
All success responses must be application/json.
$.paths[*][get,post,put,patch,delete].responses[*].content
error
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
info
schema-property-snake-or-camel
Schema properties should be snake_case or camelCase (Hypixel mixes the two — both are valid).
$.components.schemas[*].properties[*]~
warn
schema-type-required
Every top-level schema must declare its type.
$.components.schemas[?(!@.allOf && !@.oneOf && !@.anyOf)]
error
security-scheme-apikey-defined
The `ApiKey` security scheme must be defined.
$.components.securitySchemes
warn
security-scheme-header-named-correctly
The API key must be sent via the `API-Key` HTTP header.
$.components.securitySchemes.ApiKey
warn
global-security-defined
Global security must reference the ApiKey scheme.
$
info
examples-encouraged
Operations should declare at least one named example for Microcks mocking.
$.paths[*][get,post,put,patch,delete].responses.200.content.application/json
info
microcks-extension-encouraged
Operations should declare x-microcks-operation so they mock cleanly under Microcks FALLBACK dispatcher.
$.paths[*][get,post,put,patch,delete]
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# hypixel — 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 hypixel.net
#   - query-params-casing: snake @ 100% (n=34)
#   - operationid-casing: camel @ 100% (n=68)
#   - schema-names-casing: pascal @ 100% (n=22)
#   - schema-properties-casing: snake @ 87% (n=138)
#   - security: global (root) — NOT emitting operation-security-required
#   - pagination params observed: ['page']
#   - merge: kept 36 existing, added 4 measured, upgraded 0
#   - added: query-params-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-hypixel-prefix:
    description: info.title MUST start with `Hypixel` so generated clients and docs are namespaced consistently.
    message: info.title should start with `Hypixel`
    given: $.info.title
    severity: error
    then:
      function: pattern
      functionOptions:
        match: ^Hypixel
  info-description-required:
    description: info.description is required and must be substantive enough to render the docs landing
      page.
    message: info.description must be at least 100 characters
    given: $.info.description
    severity: error
    then:
      function: length
      functionOptions:
        min: 100
  info-version-v2:
    description: Hypixel Public API is on v2; pin the version field accordingly.
    message: info.version should be `v2` for the public Hypixel API
    given: $.info.version
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^v[0-9]+$
  info-contact-required:
    description: info.contact is required so consumers know where to ask API-help questions.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  info-terms-of-service-required:
    description: info.termsOfService must point at the Hypixel ToS (https://hypixel.net/tos).
    given: $.info
    severity: warn
    then:
      field: termsOfService
      function: truthy
  openapi-version-3:
    description: Use OpenAPI 3.0.x for the Hypixel spec.
    message: openapi version must be 3.0.x
    given: $.openapi
    severity: error
    then:
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-required:
    description: A non-empty servers array is required so SDKs know the base URL.
    message: At least one server entry is required
    given: $
    severity: error
    then:
      field: servers
      function: truthy
  servers-https-only:
    description: Hypixel only serves the API over HTTPS — no HTTP fallback.
    message: server.url must be HTTPS
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-hypixel-host:
    description: The base server should be api.hypixel.net.
    message: server.url should point at api.hypixel.net
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: api\.hypixel\.net
  paths-versioned:
    description: Every path must be prefixed with the API version (`/v2/`).
    message: Path must start with /v{n}/
    given: $.paths[*]~
    severity: error
    then:
      function: pattern
      functionOptions:
        match: ^/v[0-9]+/
  paths-lowercase:
    description: Path segments are lowercase across the Hypixel API.
    message: Path segments must be lowercase
    given: $.paths[*]~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9/_{}\-]+$
  paths-no-trailing-slash:
    description: Paths must not end with a trailing slash.
    message: Path must not end with `/`
    given: $.paths[*]~
    severity: error
    then:
      function: pattern
      functionOptions:
        notMatch: /$
  paths-no-query-strings:
    description: Paths must not embed query strings — use the `parameters` array.
    message: Path must not contain `?`
    given: $.paths[*]~
    severity: error
    then:
      function: pattern
      functionOptions:
        notMatch: \?
  operation-get-only:
    description: Hypixel is read-only — only GET operations are permitted.
    message: Only `get` operations are permitted on the Hypixel API
    given: $.paths[*]
    severity: error
    then:
      function: enumeration
      field: '@key'
      functionOptions:
        values:
        - get
        - parameters
        - summary
        - description
        - servers
  operation-operationid-required:
    description: Every operation must declare an operationId so SDK generators have a stable handle.
    message: operationId is required
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: operationId
      function: truthy
  operation-operationid-camelcase:
    description: operationId follows camelCase (e.g. `getPlayer`, `getSkyblockAuctions`).
    message: operationId must be camelCase
    given: $.paths[*][get,post,put,patch,delete].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  operation-summary-required:
    description: Every operation must declare a summary.
    message: Operation summary is required
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: summary
      function: truthy
  operation-summary-hypixel-prefix:
    description: Operation summaries must start with `Hypixel` for Naftiko/Microcks display consistency.
    message: Operation summary must start with `Hypixel`
    given: $.paths[*][get,post,put,patch,delete].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^Hypixel '
  operation-tags-required:
    description: Every operation must declare at least one tag for grouping.
    message: At least one tag is required per operation
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: tags
      function: truthy
  operation-description-required:
    description: Every operation must declare a description (may match summary).
    message: Operation description is required
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: description
      function: truthy
  tags-global-defined:
    description: Global tags must be declared at the spec level with descriptions.
    given: $
    severity: warn
    then:
      field: tags
      function: truthy
  tags-allowed:
    description: Operations may only use the canonical Hypixel surface tags.
    message: 'Tag must be one of: Player Data, Resources, SkyBlock, Housing, Other'
    given: $.paths[*][get,post,put,patch,delete].tags[*]
    severity: warn
    then:
      function: enumeration
      functionOptions:
        values:
        - Player Data
        - Resources
        - SkyBlock
        - Housing
        - Other
  parameter-description-required:
    description: Every parameter must have a description.
    message: Parameter description is required
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    severity: warn
    then:
      field: description
      function: truthy
  parameter-camelcase:
    description: Query and path parameters use camelCase or snake_case (matching upstream naming).
    message: Parameter name should be camelCase or snake_case
    given: $.paths[*][get,post,put,patch,delete].parameters[*].name
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9_]*$
  parameter-uuid-by-uuid:
    description: UUID-shaped player parameters should be named `uuid` for consistency with the Hypixel
      docs.
    message: Player UUID parameter should be named `uuid`
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in == 'query' && @.schema && @.schema.format
      == 'uuid')].name
    severity: info
    then:
      function: enumeration
      functionOptions:
        values:
        - uuid
        - player
        - auctioneer
        - profile
        - house
        - byUuid
  no-request-body:
    description: Hypixel is read-only; no operation should declare a requestBody.
    message: GET-only API — requestBody is not permitted
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: requestBody
      function: falsy
  response-200-required:
    description: Every operation must declare a 200 success response.
    message: 200 response is required
    given: $.paths[*][get,post,put,patch,delete].responses
    severity: error
    then:
      field: '200'
      function: truthy
  response-content-json:
    description: All success responses must be application/json.
    message: Response must declare an application/json content type
    given: $.paths[*][get,post,put,patch,delete].responses[*].content
    severity: warn
    then:
      field: application/json
      function: truthy
  response-description-required:
    description: Every response must have a description.
    message: Response description is required
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    severity: error
    then:
      field: description
      function: truthy
  schema-property-snake-or-camel:
    description: Schema properties should be snake_case or camelCase (Hypixel mixes the two — both are
      valid).
    message: Schema property must be snake_case or camelCase
    given: $.components.schemas[*].properties[*]~
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[a-zA-Z_][a-zA-Z0-9_]*$
  schema-type-required:
    description: Every top-level schema must declare its type.
    message: Schema must declare a type
    given: $.components.schemas[?(!@.allOf && !@.oneOf && !@.anyOf)]
    severity: warn
    then:
      field: type
      function: truthy
  security-scheme-apikey-defined:
    description: The `ApiKey` security scheme must be defined.
    message: components.securitySchemes.ApiKey is required
    given: $.components.securitySchemes
    severity: error
    then:
      field: ApiKey
      function: truthy
  security-scheme-header-named-correctly:
    description: The API key must be sent via the `API-Key` HTTP header.
    message: ApiKey scheme must be apiKey/header/API-Key
    given: $.components.securitySchemes.ApiKey
    severity: warn
    then:
    - field: type
      function: pattern
      functionOptions:
        match: ^apiKey$
    - field: in
      function: pattern
      functionOptions:
        match: ^header$
    - field: name
      function: pattern
      functionOptions:
        match: ^API-Key$
  global-security-defined:
    description: Global security must reference the ApiKey scheme.
    message: Global security must reference ApiKey
    given: $
    severity: warn
    then:
      field: security
      function: truthy
  examples-encouraged:
    description: Operations should declare at least one named example for Microcks mocking.
    message: Operation should declare named examples on its 200 response
    given: $.paths[*][get,post,put,patch,delete].responses.200.content.application/json
    severity: info
    then:
      field: examples
      function: truthy
  microcks-extension-encouraged:
    description: Operations should declare x-microcks-operation so they mock cleanly under Microcks FALLBACK
      dispatcher.
    message: Operation should declare x-microcks-operation
    given: $.paths[*][get,post,put,patch,delete]
    severity: info
    then:
      field: x-microcks-operation
      function: truthy
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  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: info
    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