United States Coast Guard · API Governance Rules

United States Coast Guard API Rules

Spectral linting rules defining API design standards and conventions for United States Coast Guard.

7 Rules error 3 warn 4
View Rules File View on GitHub

Rule Categories

cgmix

Rules

error
cgmix-operation-ids-required
All operations must have operationIds for client generation.
$.paths[*][get,post,put,delete,patch]
error
cgmix-vessel-id-required
PSIX endpoints require VesselID parameter.
$.paths[?(@property =~ /PSIXData/)][*].parameters[?(@.name == 'VesselID')]
warn
cgmix-xml-response-type
CGMIX APIs return XML responses.
$.paths[*][get,post].responses[*].content
warn
cgmix-operations-have-tags
All operations should have tags for grouping.
$.paths[*][get,post,put,delete,patch]
warn
cgmix-parameters-have-descriptions
All parameters should include descriptions.
$.paths[*][*].parameters[*]
warn
cgmix-info-contact
API info should include contact details.
$.info
error
cgmix-responses-documented
All operations should document at least a 200 response.
$.paths[*][get,post,put,delete,patch].responses

Spectral Ruleset

Raw ↑
rules:
  cgmix-operation-ids-required:
    description: All operations must have operationIds for client generation.
    message: Operation must have an operationId.
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: operationId
      function: truthy
    severity: error

  cgmix-vessel-id-required:
    description: PSIX endpoints require VesselID parameter.
    message: >-
      PSIX vessel operations must include VesselID as a required query
      parameter.
    given: "$.paths[?(@property =~ /PSIXData/)][*].parameters[?(@.name == 'VesselID')]"
    then:
      field: required
      function: truthy
    severity: error

  cgmix-xml-response-type:
    description: CGMIX APIs return XML responses.
    message: CGMIX operations should document text/xml response content type.
    given: "$.paths[*][get,post].responses[*].content"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            text/xml:
              type: object
    severity: warn

  cgmix-operations-have-tags:
    description: All operations should have tags for grouping.
    message: Operation must include at least one tag.
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: tags
      function: truthy
    severity: warn

  cgmix-parameters-have-descriptions:
    description: All parameters should include descriptions.
    message: Parameter must have a description.
    given: "$.paths[*][*].parameters[*]"
    then:
      field: description
      function: truthy
    severity: warn

  cgmix-info-contact:
    description: API info should include contact details.
    message: API info block must contain a contact object.
    given: "$.info"
    then:
      field: contact
      function: truthy
    severity: warn

  cgmix-responses-documented:
    description: All operations should document at least a 200 response.
    message: Operation must document a 200 success response.
    given: "$.paths[*][get,post,put,delete,patch].responses"
    then:
      field: "200"
      function: truthy
    severity: error

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/cgmix-maritime-information-exchange-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.