CNH · API Governance Rules

CNH API Rules

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

9 Rules error 4 warn 4 info 1
View Rules File View on GitHub

Rule Categories

cnh

Rules

error
cnh-info-contact
API contact information must be present.
$.info
error
cnh-server-https
All server URLs must use HTTPS.
$.servers[*].url
warn
cnh-server-host
Production server should target api.fieldops.cnh.com or api.cnh.com.
$.servers[*].url
error
cnh-oauth-security
An OAuth 2.0 security scheme must be defined.
$.components.securitySchemes[*]
error
cnh-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
cnh-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
cnh-telemetry-date-range
Telemetry GET operations must accept startDate and endDate query parameters (one-day window recommended).
$.paths[?(@property && @property.indexOf('/telemetry') > -1 || @property.indexOf('/metrics') > -1)].get
info
cnh-iso15143-profile
Telemetry endpoints should expose a `profile` parameter restricted to CP or MH.
$.paths[?(@property && @property.indexOf('/telemetry') > -1)].get.parameters[?(@.name == 'profile')].schema
warn
cnh-error-401
Operations should declare 401 Unauthorized response.
$.paths[*][get,post,put,patch,delete].responses

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas

# Spectral linting rules for CNH FieldOps API.
# Tuned to api.fieldops.cnh.com conventions: HTTPS-only, OAuth 2.0 with
# refresh/access tokens, ISO 15143-3 telemetry profiles (CP/MH), and
# tag-grouped resources for equipment, telemetry, operations,
# prescriptions, farm setup, and webhooks.
rules:
  cnh-info-contact:
    description: API contact information must be present.
    severity: error
    given: "$.info"
    then:
      field: contact
      function: truthy

  cnh-server-https:
    description: All server URLs must use HTTPS.
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  cnh-server-host:
    description: Production server should target api.fieldops.cnh.com or api.cnh.com.
    severity: warn
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "(api\\.fieldops\\.cnh\\.com|api\\.cnh\\.com)"

  cnh-oauth-security:
    description: An OAuth 2.0 security scheme must be defined.
    severity: error
    given: "$.components.securitySchemes[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            type:
              enum: ["oauth2", "openIdConnect"]

  cnh-operation-id:
    description: Every operation must declare a unique operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  cnh-operation-tags:
    description: Operations must declare at least one tag.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  cnh-telemetry-date-range:
    description: Telemetry GET operations must accept startDate and endDate query parameters (one-day window recommended).
    severity: warn
    given: "$.paths[?(@property && @property.indexOf('/telemetry') > -1 || @property.indexOf('/metrics') > -1)].get"
    then:
      field: parameters
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  cnh-iso15143-profile:
    description: Telemetry endpoints should expose a `profile` parameter restricted to CP or MH.
    severity: info
    given: "$.paths[?(@property && @property.indexOf('/telemetry') > -1)].get.parameters[?(@.name == 'profile')].schema"
    then:
      field: enum
      function: truthy

  cnh-error-401:
    description: Operations should declare 401 Unauthorized response.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required: ["401"]

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/cnh-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.