Banuba · API Governance Rules

Banuba API Rules

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

7 Rules error 6 warn 1
View Rules File View on GitHub

Rule Categories

banuba

Rules

error
banuba-face-ar-sdk-has-documentation
Banuba Face AR SDK APIs must have documentation.
$.apis[*]
error
banuba-api-has-description
All Banuba API entries must have a description.
$.apis[*]
error
banuba-api-has-name
All Banuba API entries must have a name.
$.apis[*]
error
banuba-api-has-human-url
All Banuba API entries must have a humanURL.
$.apis[*]
warn
banuba-api-has-tags
All Banuba API entries must have tags.
$.apis[*]
error
banuba-apis-json-has-name
Banuba APIs.json must have a name.
$
error
banuba-apis-json-has-description
Banuba APIs.json must have a description.
$

Spectral Ruleset

banuba-spectral-rules.yml Raw ↑
rules:
  banuba-face-ar-sdk-has-documentation:
    description: Banuba Face AR SDK APIs must have documentation.
    message: "{{description}}"
    severity: error
    given: "$.apis[*]"
    then:
      field: properties
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              type:
                const: Documentation
            required:
              - type

  banuba-api-has-description:
    description: All Banuba API entries must have a description.
    message: "{{description}}"
    severity: error
    given: "$.apis[*]"
    then:
      field: description
      function: truthy

  banuba-api-has-name:
    description: All Banuba API entries must have a name.
    message: "{{description}}"
    severity: error
    given: "$.apis[*]"
    then:
      field: name
      function: truthy

  banuba-api-has-human-url:
    description: All Banuba API entries must have a humanURL.
    message: "{{description}}"
    severity: error
    given: "$.apis[*]"
    then:
      field: humanURL
      function: truthy

  banuba-api-has-tags:
    description: All Banuba API entries must have tags.
    message: "{{description}}"
    severity: warn
    given: "$.apis[*]"
    then:
      field: tags
      function: truthy

  banuba-apis-json-has-name:
    description: Banuba APIs.json must have a name.
    message: "{{description}}"
    severity: error
    given: "$"
    then:
      field: name
      function: truthy

  banuba-apis-json-has-description:
    description: Banuba APIs.json must have a description.
    message: "{{description}}"
    severity: error
    given: "$"
    then:
      field: description
      function: truthy