Vespa · API Governance Rules

Vespa API Rules

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

7 Rules warn 7
View Rules File View on GitHub

Rule Categories

vespa

Rules

warn
vespa-info-contact-required
Vespa OpenAPI specs should include a contact pointing to vespa.ai.
$.info
warn
vespa-info-license-apache-2
Vespa is Apache 2.0 — specs should reflect that license.
$.info.license
warn
vespa-paths-document-v1-prefix
Document API paths must be rooted at /document/v1/.
$.paths[?(@property =~ /^\\/document/)]~
warn
vespa-operation-summary-title-case
Operation summaries should use Title Case.
$.paths[*][*].summary
warn
vespa-operation-id-camel-case
Operation IDs should be camelCase.
$.paths[*][*].operationId
warn
vespa-tag-defined
Every operation should declare at least one tag.
$.paths[*][*]
warn
vespa-server-defined
At least one server entry must be declared.
$.servers

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  vespa-info-contact-required:
    description: Vespa OpenAPI specs should include a contact pointing to vespa.ai.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  vespa-info-license-apache-2:
    description: Vespa is Apache 2.0 — specs should reflect that license.
    given: $.info.license
    severity: warn
    then:
      field: name
      function: pattern
      functionOptions:
        match: '^Apache'
  vespa-paths-document-v1-prefix:
    description: Document API paths must be rooted at /document/v1/.
    given: $.paths[?(@property =~ /^\\/document/)]~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^/document/v1/'
  vespa-operation-summary-title-case:
    description: Operation summaries should use Title Case.
    given: $.paths[*][*].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9 ]+$'
  vespa-operation-id-camel-case:
    description: Operation IDs should be camelCase.
    given: $.paths[*][*].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]*$'
  vespa-tag-defined:
    description: Every operation should declare at least one tag.
    given: $.paths[*][*]
    severity: warn
    then:
      field: tags
      function: truthy
  vespa-server-defined:
    description: At least one server entry must be declared.
    given: $.servers
    severity: warn
    then:
      function: truthy