iOS · API Governance Rules

iOS API Rules

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

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

Rule Categories

apple

Rules

error
apple-versioned-base-path
Every App Store Connect API path must start with /v1/, /v2/, or /v3/ (the App Store Connect API uses prefixed major-version path segments).
$.paths.*~
warn
apple-resource-camel-case
Top-level resource segments must be camelCase plural nouns (e.g. accessibilityDeclarations, appStoreVersions, betaGroups).
$.paths.*~
error
apple-operation-id-format
All operationIds must follow the {resource}_{action} pattern used by Apple (e.g. apps_createInstance, betaGroups_getCollection).
$.paths.*[get,post,put,patch,delete].operationId
error
apple-operation-tagged
Every operation must declare at least one tag.
$.paths.*[get,post,put,patch,delete]
warn
apple-operation-summary
Every operation must have a human-readable summary.
$.paths.*[get,post,put,patch,delete]
warn
apple-security-defined
The App Store Connect API authenticates with JWT bearer tokens; security schemes must be defined at the document level.
$.components.securitySchemes
info
apple-relationship-path
Relationship endpoints (JSON:API) must live under /relationships/{name} per Apple's convention.
$.paths.*~

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  # Apple uses /v1/ versioning for the App Store Connect API.
  apple-versioned-base-path:
    description: >-
      Every App Store Connect API path must start with /v1/, /v2/, or /v3/
      (the App Store Connect API uses prefixed major-version path segments).
    severity: error
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        match: '^/v[0-9]+/'

  # JSON:API style resource collection naming — camelCase plurals.
  apple-resource-camel-case:
    description: >-
      Top-level resource segments must be camelCase plural nouns
      (e.g. accessibilityDeclarations, appStoreVersions, betaGroups).
    severity: warn
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        match: '^/v[0-9]+/[a-z][a-zA-Z]+(/.*)?$'

  # operationIds follow the resource_action pattern.
  apple-operation-id-format:
    description: >-
      All operationIds must follow the {resource}_{action} pattern used by
      Apple (e.g. apps_createInstance, betaGroups_getCollection).
    severity: error
    given: $.paths.*[get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z]+(_[a-z][a-zA-Z]+){1,5}$'

  # Every operation must declare at least one tag (resource family).
  apple-operation-tagged:
    description: Every operation must declare at least one tag.
    severity: error
    given: $.paths.*[get,post,put,patch,delete]
    then:
      field: tags
      function: truthy

  # Every operation must have a human summary (we derive these from operationId).
  apple-operation-summary:
    description: Every operation must have a human-readable summary.
    severity: warn
    given: $.paths.*[get,post,put,patch,delete]
    then:
      field: summary
      function: truthy

  # JWT-bearer security is the App Store Connect API authentication.
  apple-security-defined:
    description: >-
      The App Store Connect API authenticates with JWT bearer tokens; security
      schemes must be defined at the document level.
    severity: warn
    given: $.components.securitySchemes
    then:
      function: truthy

  # JSON:API style typed responses — keep relationship endpoints distinct.
  apple-relationship-path:
    description: >-
      Relationship endpoints (JSON:API) must live under
      /relationships/{name} per Apple's convention.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        match: '^/v[0-9]+/[a-zA-Z]+/\{[^}]+\}(/relationships/[a-zA-Z]+)?(/[a-zA-Z]+)?$|^/v[0-9]+/[a-zA-Z]+(/\{[^}]+\})?$'

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/app-store-connect-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.