SAS Institute · API Governance Rules

SAS Institute API Rules

Spectral linting rules defining API design standards and conventions for SAS Institute.

5 Rules error 1 warn 3 info 1
View Rules File View on GitHub

Rule Categories

sas

Rules

warn
sas-tags-title-case
Tags should be in Title Case (e.g., Decisions, Reports)
$.tags[*].name
error
sas-operation-id-camel-case
operationId should be camelCase
$.paths.*.*.operationId
warn
sas-summary-title-case
Operation summaries should use Title Case
$.paths.*.*.summary
warn
sas-oauth-required
Operations should be secured via OAuth via SAS Logon
$.paths.*.*
info
sas-vendor-media-type
SAS Viya uses application/vnd.sas.* vendor media types for resources
$.paths.*.*.responses.*.content

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, all]]
rules:
  sas-tags-title-case:
    description: Tags should be in Title Case (e.g., Decisions, Reports)
    given: $.tags[*].name
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][a-zA-Z0-9]*)( [A-Z][a-zA-Z0-9]*)*$'
  sas-operation-id-camel-case:
    description: operationId should be camelCase
    given: $.paths.*.*.operationId
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  sas-summary-title-case:
    description: Operation summaries should use Title Case
    given: $.paths.*.*.summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z]'
  sas-oauth-required:
    description: Operations should be secured via OAuth via SAS Logon
    given: $.paths.*.*
    severity: warn
    then:
      field: security
      function: truthy
  sas-vendor-media-type:
    description: SAS Viya uses application/vnd.sas.* vendor media types for resources
    given: $.paths.*.*.responses.*.content
    severity: info
    then:
      function: pattern
      functionOptions:
        match: 'application/vnd\\.sas\\.'