Filevine · API Governance Rules

Filevine API Rules

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

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

Rule Categories

filevine

Rules

error
filevine-info-title-required
Filevine OpenAPI specs must declare info.title.
$.info
error
filevine-info-version-required
Filevine OpenAPI specs must declare info.version.
$.info
error
filevine-servers-required
Filevine OpenAPI specs must declare at least one server (US gateway).
$.servers
warn
filevine-bearer-security
Filevine API surfaces (other than identity) must declare BearerAuth.
$.components.securitySchemes
warn
filevine-operation-summary-title-case
Operation summary should start with "Filevine" and use Title Case.
$.paths[*][get,post,patch,put,delete].summary
warn
filevine-operation-id-camelcase
operationId should be camelCase.
$.paths[*][get,post,patch,put,delete].operationId
warn
filevine-tag-singular
Tags should be singular nouns or capability names (Projects, Documents, Notes, Tasks, Deadlines, TimeEntries, Contacts, Webhooks, Identity).
$.tags[*].name

Spectral Ruleset

Raw ↑
extends:
  - "spectral:oas"
rules:
  filevine-info-title-required:
    description: Filevine OpenAPI specs must declare info.title.
    given: $.info
    severity: error
    then:
      field: title
      function: truthy
  filevine-info-version-required:
    description: Filevine OpenAPI specs must declare info.version.
    given: $.info
    severity: error
    then:
      field: version
      function: truthy
  filevine-servers-required:
    description: Filevine OpenAPI specs must declare at least one server (US gateway).
    given: $.servers
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1
  filevine-bearer-security:
    description: Filevine API surfaces (other than identity) must declare BearerAuth.
    given: $.components.securitySchemes
    severity: warn
    then:
      function: truthy
  filevine-operation-summary-title-case:
    description: Operation summary should start with "Filevine" and use Title Case.
    given: $.paths[*][get,post,patch,put,delete].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^Filevine [A-Z][A-Za-z0-9]*( [A-Z][A-Za-z0-9]*)*$'
  filevine-operation-id-camelcase:
    description: operationId should be camelCase.
    given: $.paths[*][get,post,patch,put,delete].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]*$'
  filevine-tag-singular:
    description: Tags should be singular nouns or capability names (Projects, Documents, Notes, Tasks, Deadlines, TimeEntries, Contacts, Webhooks, Identity).
    given: $.tags[*].name
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^(Projects|Documents|Notes|Tasks|Deadlines|TimeEntries|Contacts|Webhooks|Identity)$'