Ruby Programming Language and Popular API Gems API Rules

Spectral linting rules defining API design standards and conventions for Ruby Programming Language and Popular API Gems.

7 Rules error 5 warn 2
View Rules File View on GitHub

Rule Categories

rubygems

Rules

error
rubygems-operation-summary-required
Every operation must have a Title Case summary.
$.paths[*][get,post,put,delete,patch,head,options]
warn
rubygems-operation-summary-title-case
Operation summaries must use Title Case (per API Evangelist convention).
$.paths[*][get,post,put,delete,patch,head,options].summary
error
rubygems-operation-id-required
Every operation must declare an operationId for SDK generation.
$.paths[*][get,post,put,delete,patch,head,options]
error
rubygems-tags-required
Every operation must have at least one tag for grouping.
$.paths[*][get,post,put,delete,patch,head,options]
warn
rubygems-json-only-success
2xx responses must offer application/json.
$.paths[*][get,post,put,delete,patch].responses['200','201'].content
error
rubygems-versioned-path
All RubyGems paths must be prefixed with /api/v1/ or /api/v2/.
$.paths
error
rubygems-api-key-security
Mutating operations (POST, PUT, DELETE) must require ApiKeyAuth.
$.paths[*][post,put,delete]

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
documentationUrl: https://guides.rubygems.org/rubygems-org-api/
rules:
  rubygems-operation-summary-required:
    description: Every operation must have a Title Case summary.
    given: $.paths[*][get,post,put,delete,patch,head,options]
    severity: error
    then:
      field: summary
      function: truthy

  rubygems-operation-summary-title-case:
    description: Operation summaries must use Title Case (per API Evangelist convention).
    given: $.paths[*][get,post,put,delete,patch,head,options].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][A-Za-z0-9]*( [A-Z][A-Za-z0-9]*)*$"

  rubygems-operation-id-required:
    description: Every operation must declare an operationId for SDK generation.
    given: $.paths[*][get,post,put,delete,patch,head,options]
    severity: error
    then:
      field: operationId
      function: truthy

  rubygems-tags-required:
    description: Every operation must have at least one tag for grouping.
    given: $.paths[*][get,post,put,delete,patch,head,options]
    severity: error
    then:
      field: tags
      function: length
      functionOptions:
        min: 1

  rubygems-json-only-success:
    description: 2xx responses must offer application/json.
    given: $.paths[*][get,post,put,delete,patch].responses['200','201'].content
    severity: warn
    then:
      field: application/json
      function: truthy

  rubygems-versioned-path:
    description: All RubyGems paths must be prefixed with /api/v1/ or /api/v2/.
    given: $.paths
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^/api/v[12]/"
      field: "@key"

  rubygems-api-key-security:
    description: Mutating operations (POST, PUT, DELETE) must require ApiKeyAuth.
    given: $.paths[*][post,put,delete]
    severity: error
    then:
      field: security
      function: truthy

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/rubygems-registry-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.