StoneX · API Governance Rules

StoneX API Rules

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

7 Rules error 3 warn 3 info 1
View Rules File View on GitHub

Rule Categories

stonex

Rules

error
stonex-bearer-auth-required
All StoneX API operations must use Bearer JWT authentication.
$.components.securitySchemes
error
stonex-response-200-or-201-required
All StoneX operations must define a 2xx success response.
$.paths[*][*]
warn
stonex-operationid-camel-case
OperationIds must use camelCase.
$.paths[*][*].operationId
warn
stonex-tags-title-case
All operation tags must use Title Case.
$.paths[*][*].tags[*]
error
stonex-server-https
All StoneX API servers must use HTTPS with TLS 1.3.
$.servers[*].url
info
stonex-iso-currency-description
Currency parameters must reference ISO 4217 in their description to ensure standardized currency code usage.
$.paths[*][*].parameters[?(@.name =~ /currency/i)]
warn
stonex-path-parameters-kebab-case
Path segments (not parameters) should use kebab-case.
$.paths[*]~

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  stonex-bearer-auth-required:
    description: >-
      All StoneX API operations must use Bearer JWT authentication.
    message: "Operations must declare BearerAuth security scheme."
    severity: error
    given: "$.components.securitySchemes"
    then:
      field: BearerAuth
      function: defined

  stonex-response-200-or-201-required:
    description: All StoneX operations must define a 2xx success response.
    message: "Operation must define a 200 or 201 response."
    severity: error
    given: "$.paths[*][*]"
    then:
      function: schema
      functionOptions:
        schema:
          properties:
            responses:
              type: object

  stonex-operationid-camel-case:
    description: OperationIds must use camelCase.
    message: "OperationId '{{value}}' must be camelCase."
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  stonex-tags-title-case:
    description: All operation tags must use Title Case.
    message: "Tag '{{value}}' must use Title Case."
    severity: warn
    given: "$.paths[*][*].tags[*]"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 &-]*$"

  stonex-server-https:
    description: All StoneX API servers must use HTTPS with TLS 1.3.
    message: "Server URL must use HTTPS."
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  stonex-iso-currency-description:
    description: >-
      Currency parameters must reference ISO 4217 in their description
      to ensure standardized currency code usage.
    message: "Currency parameter must mention ISO 4217."
    severity: info
    given: "$.paths[*][*].parameters[?(@.name =~ /currency/i)]"
    then:
      field: description
      function: truthy

  stonex-path-parameters-kebab-case:
    description: Path segments (not parameters) should use kebab-case.
    message: "Path '{{path}}' contains uppercase characters."
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^[/a-z0-9{}_-]*$"

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/stonex-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 email required.

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