Vantiv · API Governance Rules

Vantiv API Rules

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

8 Rules error 1 warn 6 info 1
View Rules File View on GitHub

Rule Categories

vantiv

Rules

warn
vantiv-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
vantiv-operation-ids-present
All operations must have an operationId
$.paths[*][*]
warn
vantiv-merchant-id-required
Transaction requests should include merchantId
$.components.schemas[*].properties.merchantId
info
vantiv-amount-in-cents
Transaction amounts are denominated in cents (integer)
$.components.schemas[*].properties.amount
warn
vantiv-xml-content-type
Vantiv API uses application/xml content type
$.paths[*][*].requestBody.content
warn
vantiv-tags-defined
Operations should be tagged for grouping
$.paths[*][*]
warn
vantiv-cnp-txn-id-int64
cnpTxnId fields should be int64 format
$.components.schemas[*].properties.cnpTxnId
warn
vantiv-basic-auth-scheme
Vantiv uses HTTP Basic authentication
$.components.securitySchemes.basicAuth

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  vantiv-operation-summary-title-case:
    description: All operation summaries must use Title Case
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]*$"

  vantiv-operation-ids-present:
    description: All operations must have an operationId
    severity: error
    given: "$.paths[*][*]"
    then:
      field: operationId
      function: truthy

  vantiv-merchant-id-required:
    description: Transaction requests should include merchantId
    severity: warn
    given: "$.components.schemas[*].properties.merchantId"
    then:
      function: defined

  vantiv-amount-in-cents:
    description: Transaction amounts are denominated in cents (integer)
    severity: info
    given: "$.components.schemas[*].properties.amount"
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
          - integer

  vantiv-xml-content-type:
    description: Vantiv API uses application/xml content type
    severity: warn
    given: "$.paths[*][*].requestBody.content"
    then:
      function: pattern
      functionOptions:
        match: "application/xml"

  vantiv-tags-defined:
    description: Operations should be tagged for grouping
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  vantiv-cnp-txn-id-int64:
    description: cnpTxnId fields should be int64 format
    severity: warn
    given: "$.components.schemas[*].properties.cnpTxnId"
    then:
      field: format
      function: enumeration
      functionOptions:
        values:
          - int64

  vantiv-basic-auth-scheme:
    description: Vantiv uses HTTP Basic authentication
    severity: warn
    given: "$.components.securitySchemes.basicAuth"
    then:
      field: scheme
      function: enumeration
      functionOptions:
        values:
          - basic