Buildxact · API Governance Rules

Buildxact API Rules

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

7 Rules error 1 warn 4 info 2
View Rules File View on GitHub

Rule Categories

buildxact

Rules

warn
buildxact-info-contact
All Buildxact OpenAPI documents should declare an info.contact with a URL pointing to the developer portal.
$.info
warn
buildxact-summary-title-case
Operation summaries must use Title Case (matches the rest of the api-evangelist catalog).
$.paths.*[get,put,post,delete,patch,options,head].summary
error
buildxact-operation-tags
Every Buildxact operation must declare at least one tag so it can be grouped in docs.
$.paths.*[get,put,post,delete,patch,options,head]
warn
buildxact-operation-description
Operations should describe what they do and call out OData support where applicable.
$.paths.*[get,put,post,delete,patch,options,head]
warn
buildxact-security-headers
Buildxact uses Azure API Management — every operation must require both a subscription key and a bearer token.
$
info
buildxact-odata-page-size
Collection list endpoints should expose $top, $skip, and $count parameters.
$.paths[?(@property =~ /^\/.*s$/)].get.parameters[*].name
info
buildxact-rate-limit-response
Operations should document a 429 response since Buildxact enforces 100 requests / 30 seconds.
$.paths.*[get,put,post,delete,patch].responses

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  buildxact-info-contact:
    description: All Buildxact OpenAPI documents should declare an info.contact with a URL pointing to the developer portal.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  buildxact-summary-title-case:
    description: Operation summaries must use Title Case (matches the rest of the api-evangelist catalog).
    given: $.paths.*[get,put,post,delete,patch,options,head].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][a-z0-9]*)(\s[A-Z][a-z0-9]*)*$|^([A-Z][A-Za-z0-9]*\s)+([A-Z][A-Za-z0-9]*)$|^([A-Z][A-Za-z0-9]+)(\s+([A-Z][A-Za-z0-9]+|by|with|of|the|and|to|in|on|for|a|an))*$'
  buildxact-operation-tags:
    description: Every Buildxact operation must declare at least one tag so it can be grouped in docs.
    given: $.paths.*[get,put,post,delete,patch,options,head]
    severity: error
    then:
      field: tags
      function: length
      functionOptions:
        min: 1
  buildxact-operation-description:
    description: Operations should describe what they do and call out OData support where applicable.
    given: $.paths.*[get,put,post,delete,patch,options,head]
    severity: warn
    then:
      field: description
      function: truthy
  buildxact-security-headers:
    description: Buildxact uses Azure API Management — every operation must require both a subscription key and a bearer token.
    given: $
    severity: warn
    then:
      field: security
      function: truthy
  buildxact-odata-page-size:
    description: Collection list endpoints should expose $top, $skip, and $count parameters.
    given: $.paths[?(@property =~ /^\/.*s$/)].get.parameters[*].name
    severity: info
    then:
      function: pattern
      functionOptions:
        match: '^(\$filter|\$orderBy|\$top|\$skip|\$count)$'
  buildxact-rate-limit-response:
    description: Operations should document a 429 response since Buildxact enforces 100 requests / 30 seconds.
    given: $.paths.*[get,put,post,delete,patch].responses
    severity: info
    then:
      field: '429'
      function: truthy