SignNow · API Governance Rules

SignNow API Rules

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

9 Rules error 2 warn 6 info 1
View Rules File View on GitHub

Rule Categories

signnow

Rules

warn
signnow-operation-summary-title-case
All operation summaries must use Title Case.
$.paths[*][*].summary
warn
signnow-operation-ids-kebab
Operation IDs should use camelCase consistent with SignNow conventions.
$.paths[*][*].operationId
warn
signnow-bearer-auth-required
All operations (except authentication) must require BearerAuth security.
$.paths[?([email protected](/oauth2/))][*]
info
signnow-document-id-path-param
Document ID path parameters should be named document_id.
$.paths./document/{document_id}[*].parameters[*]
warn
signnow-error-schema-defined
Error responses must reference the Error schema.
$.paths[*][*].responses[?(@property >= '400')].content['application/json'].schema
error
signnow-response-200-defined
All successful operations must define a 200 response.
$.paths[*][*].responses
warn
signnow-tags-defined
All operations must include at least one tag.
$.paths[*][*]
warn
signnow-description-present
All operations must have a description.
$.paths[*][*]
error
signnow-no-empty-paths
API paths must not be empty.
$.paths[*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  signnow-operation-summary-title-case:
    description: All operation summaries must use Title Case.
    message: 'Summary "{{value}}" must use Title Case.'
    severity: warn
    given: '$.paths[*][*].summary'
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][a-z]+(\s[A-Z][a-z]+)*$'

  signnow-operation-ids-kebab:
    description: Operation IDs should use camelCase consistent with SignNow conventions.
    message: 'OperationId "{{value}}" should be camelCase.'
    severity: warn
    given: '$.paths[*][*].operationId'
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'

  signnow-bearer-auth-required:
    description: All operations (except authentication) must require BearerAuth security.
    message: Operation must declare security requirements.
    severity: warn
    given: '$.paths[?([email protected](/oauth2/))][*]'
    then:
      field: security
      function: defined

  signnow-document-id-path-param:
    description: Document ID path parameters should be named document_id.
    message: 'Document ID path parameters should be named "document_id".'
    severity: info
    given: '$.paths./document/{document_id}[*].parameters[*]'
    then:
      field: name
      function: enumeration
      functionOptions:
        values:
        - document_id

  signnow-error-schema-defined:
    description: Error responses must reference the Error schema.
    message: Error responses (4xx/5xx) must reference the Error schema component.
    severity: warn
    given: "$.paths[*][*].responses[?(@property >= '400')].content['application/json'].schema"
    then:
      function: defined

  signnow-response-200-defined:
    description: All successful operations must define a 200 response.
    message: Operation must define a 200 success response.
    severity: error
    given: '$.paths[*][*].responses'
    then:
      field: '200'
      function: defined

  signnow-tags-defined:
    description: All operations must include at least one tag.
    message: Operation must include at least one tag for categorization.
    severity: warn
    given: '$.paths[*][*]'
    then:
      field: tags
      function: defined

  signnow-description-present:
    description: All operations must have a description.
    message: Operation must include a description.
    severity: warn
    given: '$.paths[*][*]'
    then:
      field: description
      function: defined

  signnow-no-empty-paths:
    description: API paths must not be empty.
    message: Path must define at least one operation.
    severity: error
    given: '$.paths[*]'
    then:
      function: length
      functionOptions:
        min: 1