Canix · API Governance Rules

Canix API Rules

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

66 Rules error 47 warn 18 info 1
Generated by API Evangelist Written by API Evangelist tooling for Canix's APIs. It is a starting point, not a ruleset Canix publishes or enforces.
View Rules File View on GitHub

Rule Categories

contact info mediatype operation operationid parameter path property requestbody response root schema securityscheme server servers tag write

Rules

error
operation-has-operationid
Every operation declares an operationId (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete]
warn
operationid-casing-pascal
operationIds are pascal case (measured: 98% of this contract)
$.paths[*][get,post,put,patch,delete].operationId
error
operation-has-summary
Every operation has a summary (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete]
warn
operation-has-description
Every operation has a description (measured: 97% of this contract)
$.paths[*][get,post,put,patch,delete]
error
operation-has-tags
Every operation is tagged (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete]
error
operation-has-success-response
Every operation declares a 2xx response (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete].responses
error
operation-declares-4xx
Every operation declares at least one 4xx response (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete].responses
warn
operation-declares-401-or-403
Every operation declares 401 or 403 (measured: 98% of this contract)
$.paths[*][get,post,put,patch,delete].responses
error
root-security-declared
The contract declares security at the root (measured: 100% of this contract)
$
error
path-segment-casing-snake
Path segments are snake case (measured: 100% of this contract)
$.paths[*]~
error
path-no-trailing-slash
Paths carry no trailing slash (measured: 100% of this contract)
$.paths[*]~
error
path-params-in-braces
Path parameters use {braces}, not :colon (measured: 100% of this contract)
$.paths[*]~
error
servers-https
Servers are https (measured: 100% of this contract)
$.servers[*].url
warn
write-declares-request-body
POST and PUT declare a request body (measured: 93% of this contract)
$.paths[*][post,put]
error
response-media-type
Responses are served as application/json (measured: 100% of this contract)
$.paths[*][get,post,put,patch,delete].responses[*].content
warn
schema-has-description
Every component schema carries a title or description (measured: 98% of this contract)
$.components.schemas[*]
error
property-name-casing-snake
Schema property names are snake case (measured: 100% of this contract)
$.components.schemas[*].properties[*]~
error
info-has-description
The contract's info block carries a description (measured: 100% of this contract)
$.info
error
info-has-contact-or-terms
The contract's info block names a contact or terms of service (measured: 100% of this contract)
$.info
error
info-title-present
Info declares title (measured: 100% of this contract)
$.info
warn
info-title-min-length
Info.title runs at least 16 characters (measured: 96% of this contract)
$.info.title
error
info-description-present
Info declares description (measured: 100% of this contract)
$.info
error
info-description-min-length
Info.description runs at least 554 characters (measured: 100% of this contract)
$.info.description
error
info-contact-present
Info declares contact (measured: 100% of this contract)
$.info
error
info-version-present
Info declares version (measured: 100% of this contract)
$.info
error
info-version-semver
info.version is numeric (measured: 100% of this contract)
$.info.version
error
contact-name-present
Contact declares name (measured: 100% of this contract)
$.info.contact
error
contact-url-present
Contact declares url (measured: 100% of this contract)
$.info.contact
error
contact-url-https
Contact.url is https (measured: 100% of this contract)
$.info.contact.url
error
contact-email-present
Contact declares email (measured: 100% of this contract)
$.info.contact
error
server-url-present
Server declares url (measured: 100% of this contract)
$.servers[*]
error
server-url-https
Server.url is https (measured: 100% of this contract)
$.servers[*].url
error
server-variables-present
Server declares variables (measured: 100% of this contract)
$.servers[*]
error
tag-name-present
Tag declares name (measured: 100% of this contract)
$.tags[*]
error
operation-tags-present
Operation declares tags (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
error
operation-summary-present
Operation declares summary (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
warn
operation-summary-min-length
Operation.summary runs at least 9 characters (measured: 95% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].summary
warn
operation-description-present
Operation declares description (measured: 97% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
warn
operation-description-min-length
Operation.description runs at least 15 characters (measured: 97% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].description
error
operation-operationid-present
Operation declares operationId (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
warn
operation-operationid-casing-pascal
Operation.operationId is pascal case (measured: 98% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].operationId
info
operation-parameters-present
Operation declares parameters (measured: 87% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
error
operation-responses-present
Operation declares responses (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace]
error
parameter-name-present
Parameter declares name (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
error
parameter-name-casing-snake
Parameter.name is snake case (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].name
error
parameter-in-present
Parameter declares in (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
error
parameter-in-values
Parameter.in is one of path, query (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].in
warn
parameter-description-present
Parameter declares description (measured: 98% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
warn
parameter-description-min-length
Parameter.description runs at least 8 characters (measured: 96% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].description
error
parameter-schema-present
Parameter declares schema (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
warn
requestbody-description-present
RequestBody declares description (measured: 93% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
error
requestbody-content-present
RequestBody declares content (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
warn
requestbody-required-present
RequestBody declares required (measured: 93% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
error
mediatype-schema-present
MediaType declares schema (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].responses[*].content[*]
error
response-description-present
Response declares description (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].responses[*]
error
response-description-min-length
Response.description runs at least 2 characters (measured: 100% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].responses[*].description
warn
response-content-present
Response declares content (measured: 98% of this contract)
$.paths[*][get,put,post,delete,patch,options,head,trace].responses[*]
warn
schema-title-present
Schema declares title (measured: 98% of this contract)
$.components.schemas[*]
warn
schema-type-values
Schema.type is one of object (measured: 96% of this contract)
$.components.schemas[*].type
error
schema-description-min-length
Schema.description runs at least 96 characters (measured: 100% of this contract)
$.components.schemas[*].description
warn
schema-properties-present
Schema declares properties (measured: 97% of this contract)
$.components.schemas[*]
error
securityscheme-type-present
SecurityScheme declares type (measured: 100% of this contract)
$.components.securitySchemes[*]
error
securityscheme-type-values
SecurityScheme.type is one of apiKey (measured: 100% of this contract)
$.components.securitySchemes[*].type
error
securityscheme-name-present
SecurityScheme declares name (measured: 100% of this contract)
$.components.securitySchemes[*]
error
securityscheme-in-present
SecurityScheme declares in (measured: 100% of this contract)
$.components.securitySchemes[*]
error
securityscheme-in-values
SecurityScheme.in is one of header (measured: 100% of this contract)
$.components.securitySchemes[*].in

Spectral Ruleset

Raw ↑
# authorship: generated by API Evangelist tooling (derive-rules.py, 2026-11-01). x-method: generated
# Every rule below was MEASURED against Canix's own contract before it was written; a rule is present only
# when the contract satisfies it at 80% or more. Severity: 100% -> error, >= 90% -> warn, else info.
# Provenance:
#   - operation-has-operationid: 100%
#   - operationid-casing-pascal: 99%
#   - operation-has-summary: 100%
#   - operation-has-description: 98%
#   - operation-has-tags: 100%
#   - operation-has-success-response: 100%
#   - operation-declares-4xx: 100%
#   - operation-declares-401-or-403: 99%
#   - root-security-declared: 100%
#   - path-segment-casing-snake: 100%
#   - path-no-trailing-slash: 100%
#   - path-params-in-braces: 100%
#   - servers-https: 100%
#   - write-declares-request-body: 94%
#   - response-media-type: 100%
#   - schema-has-description: 99%
#   - property-name-casing-snake: 100%
#   - info-has-description: 100%
#   - info-has-contact-or-terms: 100%
#   - info-title-present: 100%
#   - info-title-min-length: 96%
#   - info-description-present: 100%
#   - info-description-min-length: 100%
#   - info-contact-present: 100%
#   - info-version-present: 100%
#   - info-version-semver: 100%
#   - contact-name-present: 100%
#   - contact-url-present: 100%
#   - contact-url-https: 100%
#   - contact-email-present: 100%
#   - server-url-present: 100%
#   - server-url-https: 100%
#   - server-variables-present: 100%
#   - tag-name-present: 100%
#   - operation-tags-present: 100%
#   - operation-summary-present: 100%
#   - operation-summary-min-length: 95%
#   - operation-description-present: 98%
#   - operation-description-min-length: 98%
#   - operation-operationid-present: 100%
#   - operation-operationid-casing-pascal: 99%
#   - operation-parameters-present: 87%
#   - operation-responses-present: 100%
#   - parameter-name-present: 100%
#   - parameter-name-casing-snake: 100%
#   - parameter-in-present: 100%
#   - parameter-in-values: 100%
#   - parameter-description-present: 98%
#   - parameter-description-min-length: 97%
#   - parameter-schema-present: 100%
#   - requestbody-description-present: 93%
#   - requestbody-content-present: 100%
#   - requestbody-required-present: 93%
#   - mediatype-schema-present: 100%
#   - response-description-present: 100%
#   - response-description-min-length: 100%
#   - response-content-present: 99%
#   - schema-title-present: 98%
#   - schema-type-values: 97%
#   - schema-description-min-length: 100%
#   - schema-properties-present: 97%
#   - securityscheme-type-present: 100%
#   - securityscheme-type-values: 100%
#   - securityscheme-name-present: 100%
#   - securityscheme-in-present: 100%
#   - securityscheme-in-values: 100%
x-method: generated
x-generator: derive-rules.py
x-generated: '2026-11-01'
x-source:
- openapi/canix-audited-actions-api-openapi.yml
- openapi/canix-bill-of-materials-api-openapi.yml
- openapi/canix-brands-api-openapi.yml
- openapi/canix-company-api-openapi.yml
- openapi/canix-customers-api-openapi.yml
x-self-check:
  status: checked
  rules: 67
  dropped:
    parameter-required-present: claims 100%, failed 69
extends:
- - spectral:oas
  - recommended
formats:
- oas3
rules:
  operation-has-operationid:
    description: 'Every operation declares an operationId (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
    x-pattern-key: Operation.operationId|present
  operationid-casing-pascal:
    description: 'operationIds are pascal case (measured: 98% of this contract)'
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    x-pattern-key: Operation.operationId|pattern:^[A-Z][a-zA-Z0-9]*$
  operation-has-summary:
    description: 'Every operation has a summary (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
    x-pattern-key: Operation.summary|present
  operation-has-description:
    description: 'Every operation has a description (measured: 97% of this contract)'
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
    x-pattern-key: Operation.description|present
  operation-has-tags:
    description: 'Every operation is tagged (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
    x-pattern-key: Operation.tags|present
  operation-has-success-response:
    description: 'Every operation declares a 2xx response (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          patternProperties:
            ^2\d\d$: {}
          minProperties: 1
    x-pattern-key: Operation.responses|schema:07e20b47
  operation-declares-4xx:
    description: 'Every operation declares at least one 4xx response (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          patternProperties:
            ^4\d\d$: {}
          minProperties: 1
    x-pattern-key: Operation.responses|schema:4aea4da4
  operation-declares-401-or-403:
    description: 'Every operation declares 401 or 403 (measured: 98% of this contract)'
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
          - required:
            - '401'
          - required:
            - '403'
    x-pattern-key: Operation.responses|schema:f26ae517
  root-security-declared:
    description: 'The contract declares security at the root (measured: 100% of this contract)'
    severity: error
    given: $
    then:
      field: security
      function: truthy
    x-pattern-key: OpenAPI.security|present
  path-segment-casing-snake:
    description: 'Path segments are snake case (measured: 100% of this contract)'
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9]+(_[a-z0-9]+)*|/\{[^}]+\})+/?$
    x-pattern-key: Paths.{key}|pattern:^(/[a-z0-9]+(_[a-z0-9]+)*|/\{[^}]+\})+/?$
  path-no-trailing-slash:
    description: 'Paths carry no trailing slash (measured: 100% of this contract)'
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: ./$
    x-pattern-key: Paths.{key}|pattern:!./$
  path-params-in-braces:
    description: 'Path parameters use {braces}, not :colon (measured: 100% of this contract)'
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: ':'
    x-pattern-key: 'Paths.{key}|pattern:!:'
  servers-https:
    description: 'Servers are https (measured: 100% of this contract)'
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^(https://|\{)
    x-pattern-key: Server.url|pattern:^(https://|\{)
  write-declares-request-body:
    description: 'POST and PUT declare a request body (measured: 93% of this contract)'
    severity: warn
    given: $.paths[*][post,put]
    then:
      field: requestBody
      function: truthy
    x-pattern-key: Operation.requestBody|present
  response-media-type:
    description: 'Responses are served as application/json (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*].content
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
          - application/json
    x-pattern-key: Response.content|schema:2919cf38
  schema-has-description:
    description: 'Every component schema carries a title or description (measured: 98% of this contract)'
    severity: warn
    given: $.components.schemas[*]
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - description
          - required:
            - title
    x-pattern-key: Components.schemas|schema:7af42428
  property-name-casing-snake:
    description: 'Schema property names are snake case (measured: 100% of this contract)'
    severity: error
    given: $.components.schemas[*].properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9]+(_[a-z0-9]+)*$
    x-pattern-key: Schema.properties{key}|pattern:^[a-z0-9]+(_[a-z0-9]+)*$
  info-has-description:
    description: 'The contract''s info block carries a description (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
    x-pattern-key: Info.description|present
  info-has-contact-or-terms:
    description: 'The contract''s info block names a contact or terms of service (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - contact
          - required:
            - termsOfService
    x-pattern-key: OpenAPI.info|schema:093268bf
  info-title-present:
    description: 'Info declares title (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      field: title
      function: defined
    x-pattern-key: Info.title|present
  info-title-min-length:
    description: 'Info.title runs at least 16 characters (measured: 96% of this contract)'
    severity: warn
    given: $.info.title
    then:
      function: length
      functionOptions:
        min: 16
    x-pattern-key: Info.title|length
  info-description-present:
    description: 'Info declares description (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      field: description
      function: defined
    x-pattern-key: Info.description|present
  info-description-min-length:
    description: 'Info.description runs at least 554 characters (measured: 100% of this contract)'
    severity: error
    given: $.info.description
    then:
      function: length
      functionOptions:
        min: 554
    x-pattern-key: Info.description|length
  info-contact-present:
    description: 'Info declares contact (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      field: contact
      function: defined
    x-pattern-key: Info.contact|present
  info-version-present:
    description: 'Info declares version (measured: 100% of this contract)'
    severity: error
    given: $.info
    then:
      field: version
      function: defined
    x-pattern-key: Info.version|present
  info-version-semver:
    description: 'info.version is numeric (measured: 100% of this contract)'
    severity: error
    given: $.info.version
    then:
      function: pattern
      functionOptions:
        match: ^v?\d+(\.\d+)*
    x-pattern-key: Info.version|pattern:^v?\d+(\.\d+)*
  contact-name-present:
    description: 'Contact declares name (measured: 100% of this contract)'
    severity: error
    given: $.info.contact
    then:
      field: name
      function: defined
    x-pattern-key: Contact.name|present
  contact-url-present:
    description: 'Contact declares url (measured: 100% of this contract)'
    severity: error
    given: $.info.contact
    then:
      field: url
      function: defined
    x-pattern-key: Contact.url|present
  contact-url-https:
    description: 'Contact.url is https (measured: 100% of this contract)'
    severity: error
    given: $.info.contact.url
    then:
      function: pattern
      functionOptions:
        match: ^https://
    x-pattern-key: Contact.url|pattern:^https://
  contact-email-present:
    description: 'Contact declares email (measured: 100% of this contract)'
    severity: error
    given: $.info.contact
    then:
      field: email
      function: defined
    x-pattern-key: Contact.email|present
  server-url-present:
    description: 'Server declares url (measured: 100% of this contract)'
    severity: error
    given: $.servers[*]
    then:
      field: url
      function: defined
    x-pattern-key: Server.url|present
  server-url-https:
    description: 'Server.url is https (measured: 100% of this contract)'
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
    x-pattern-key: Server.url|pattern:^https://
  server-variables-present:
    description: 'Server declares variables (measured: 100% of this contract)'
    severity: error
    given: $.servers[*]
    then:
      field: variables
      function: defined
    x-pattern-key: Server.variables|present
  tag-name-present:
    description: 'Tag declares name (measured: 100% of this contract)'
    severity: error
    given: $.tags[*]
    then:
      field: name
      function: defined
    x-pattern-key: Tag.name|present
  operation-tags-present:
    description: 'Operation declares tags (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: tags
      function: defined
    x-pattern-key: Operation.tags|present
  operation-summary-present:
    description: 'Operation declares summary (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: summary
      function: defined
    x-pattern-key: Operation.summary|present
  operation-summary-min-length:
    description: 'Operation.summary runs at least 9 characters (measured: 95% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].summary
    then:
      function: length
      functionOptions:
        min: 9
    x-pattern-key: Operation.summary|length
  operation-description-present:
    description: 'Operation declares description (measured: 97% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: description
      function: defined
    x-pattern-key: Operation.description|present
  operation-description-min-length:
    description: 'Operation.description runs at least 15 characters (measured: 97% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].description
    then:
      function: length
      functionOptions:
        min: 15
    x-pattern-key: Operation.description|length
  operation-operationid-present:
    description: 'Operation declares operationId (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: operationId
      function: defined
    x-pattern-key: Operation.operationId|present
  operation-operationid-casing-pascal:
    description: 'Operation.operationId is pascal case (measured: 98% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    x-pattern-key: Operation.operationId|pattern:^[A-Z][a-zA-Z0-9]*$
  operation-parameters-present:
    description: 'Operation declares parameters (measured: 87% of this contract)'
    severity: info
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: parameters
      function: defined
    x-pattern-key: Operation.parameters|present
  operation-responses-present:
    description: 'Operation declares responses (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace]
    then:
      field: responses
      function: defined
    x-pattern-key: Operation.responses|present
  parameter-name-present:
    description: 'Parameter declares name (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
    then:
      field: name
      function: defined
    x-pattern-key: Parameter.name|present
  parameter-name-casing-snake:
    description: 'Parameter.name is snake case (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9]+(_[a-z0-9]+)*$
    x-pattern-key: Parameter.name|pattern:^[a-z0-9]+(_[a-z0-9]+)*$
  parameter-in-present:
    description: 'Parameter declares in (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
    then:
      field: in
      function: defined
    x-pattern-key: Parameter.in|present
  parameter-in-values:
    description: 'Parameter.in is one of path, query (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].in
    then:
      function: enumeration
      functionOptions:
        values:
        - path
        - query
    x-pattern-key: Parameter.in|enum:path,query
  parameter-description-present:
    description: 'Parameter declares description (measured: 98% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
    then:
      field: description
      function: defined
    x-pattern-key: Parameter.description|present
  parameter-description-min-length:
    description: 'Parameter.description runs at least 8 characters (measured: 96% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*].description
    then:
      function: length
      functionOptions:
        min: 8
    x-pattern-key: Parameter.description|length
  parameter-schema-present:
    description: 'Parameter declares schema (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].parameters[*]
    then:
      field: schema
      function: defined
    x-pattern-key: Parameter.schema|present
  requestbody-description-present:
    description: 'RequestBody declares description (measured: 93% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
    then:
      field: description
      function: defined
    x-pattern-key: RequestBody.description|present
  requestbody-content-present:
    description: 'RequestBody declares content (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
    then:
      field: content
      function: defined
    x-pattern-key: RequestBody.content|present
  requestbody-required-present:
    description: 'RequestBody declares required (measured: 93% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].requestBody
    then:
      field: required
      function: defined
    x-pattern-key: RequestBody.required|present
  mediatype-schema-present:
    description: 'MediaType declares schema (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].responses[*].content[*]
    then:
      field: schema
      function: defined
    x-pattern-key: MediaType.schema|present
  response-description-present:
    description: 'Response declares description (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].responses[*]
    then:
      field: description
      function: defined
    x-pattern-key: Response.description|present
  response-description-min-length:
    description: 'Response.description runs at least 2 characters (measured: 100% of this contract)'
    severity: error
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].responses[*].description
    then:
      function: length
      functionOptions:
        min: 2
    x-pattern-key: Response.description|length
  response-content-present:
    description: 'Response declares content (measured: 98% of this contract)'
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,options,head,trace].responses[*]
    then:
      field: content
      function: defined
    x-pattern-key: Response.content|present
  schema-title-present:
    description: 'Schema declares title (measured: 98% of this contract)'
    severity: warn
    given: $.components.schemas[*]
    then:
      field: title
      function: defined
    x-pattern-key: Schema.title|present
  schema-type-values:
    description: 'Schema.type is one of object (measured: 96% of this contract)'
    severity: warn
    given: $.components.schemas[*].type
    then:
      function: enumeration
      functionOptions:
        values:
        - object
    x-pattern-key: Schema.type|enum:object
  schema-description-min-length:
    description: 'Schema.description runs at least 96 characters (measured: 100% of this contract)'
    severity: error
    given: $.components.schemas[*].description
    then:
      function: length
      functionOptions:
        min: 96
    x-pattern-key: Schema.description|length
  schema-properties-present:
    description: 'Schema declares properties (measured: 97% of this contract)'
    severity: warn
    given: $.components.schemas[*]
    then:
      field: properties
      function: defined
    x-pattern-key: Schema.properties|present
  securityscheme-type-present:
    description: 'SecurityScheme declares type (measured: 100% of this contract)'
    severity: error
    given: $.components.securitySchemes[*]
    then:
      field: type
      function: defined
    x-pattern-key: SecurityScheme.type|present
  securityscheme-type-values:
    description: 'SecurityScheme.type is one of apiKey (measured: 100% of this contract)'
    severity: error
    given: $.components.securitySchemes[*].type
    then:
      function: enumeration
      functionOptions:
        values:
        - apiKey
    x-pattern-key: SecurityScheme.type|enum:apiKey
  securityscheme-name-present:
    description: 'SecurityScheme declares name (measured: 100% of this contract)'
    severity: error
    given: $.components.securitySchemes[*]
    then:
      field: name
      function: defined
    x-pattern-key: SecurityScheme.name|present
  securityscheme-in-present:
    description: 'SecurityScheme declares in (measured: 100% of this contract)'
    severity: error
    given: $.components.securitySchemes[*]
    then:
      field: in
      function: defined
    x-pattern-key: SecurityScheme.in|present
  securityscheme-in-values:
    description: 'SecurityScheme.in is one of header (measured: 100% of this contract)'
    severity: error
    given: $.components.securitySchemes[*].in
    then:
      function: enumeration
      functionOptions:
        values:
        - header
    x-pattern-key: SecurityScheme.in|enum:header

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/canix-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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.