Xquik · API Governance Rules

Xquik API Rules

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

20 Rules error 15 warn 3 info 2
View Rules File View on GitHub

Rule Categories

xquik

Rules

error
xquik-openapi-version
Use OpenAPI 3.1.
$
error
xquik-info-title
Provide the API title.
$.info
error
xquik-info-description
Describe the API.
$.info
error
xquik-info-version
Provide the API version.
$.info
error
xquik-info-contact
Provide maintainer contact details.
$.info
warn
xquik-contact-name
Name the API maintainer.
$.info.contact
warn
xquik-contact-url
Link the API maintainer.
$.info.contact
warn
xquik-contact-email
Publish the support email.
$.info.contact
error
xquik-servers
Declare a production server.
$
error
xquik-server-url
Give each server a URL.
$.servers[*]
info
xquik-tags
Define shared operation tags.
$
error
xquik-paths
Publish API paths.
$
error
xquik-operation-summary
Summarize every operation.
$.paths[*][get,post,put,patch,delete]
error
xquik-operation-id
Identify every operation.
$.paths[*][get,post,put,patch,delete]
error
xquik-operation-tags
Group every operation.
$.paths[*][get,post,put,patch,delete]
error
xquik-operation-responses
Document operation responses.
$.paths[*][get,post,put,patch,delete]
info
xquik-components
Publish reusable components.
$
error
xquik-component-schemas
Publish reusable schemas.
$.components
error
xquik-security-schemes
Declare authentication schemes.
$.components
error
xquik-security
Apply authentication requirements.
$

Spectral Ruleset

Raw ↑
rules:
  xquik-openapi-version:
    description: Use OpenAPI 3.1.
    given: '$'
    severity: error
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: '^3\.1\.'
  xquik-info-title:
    description: Provide the API title.
    given: '$.info'
    severity: error
    then:
      field: title
      function: truthy
  xquik-info-description:
    description: Describe the API.
    given: '$.info'
    severity: error
    then:
      field: description
      function: truthy
  xquik-info-version:
    description: Provide the API version.
    given: '$.info'
    severity: error
    then:
      field: version
      function: truthy
  xquik-info-contact:
    description: Provide maintainer contact details.
    given: '$.info'
    severity: error
    then:
      field: contact
      function: truthy
  xquik-contact-name:
    description: Name the API maintainer.
    given: '$.info.contact'
    severity: warn
    then:
      field: name
      function: truthy
  xquik-contact-url:
    description: Link the API maintainer.
    given: '$.info.contact'
    severity: warn
    then:
      field: url
      function: truthy
  xquik-contact-email:
    description: Publish the support email.
    given: '$.info.contact'
    severity: warn
    then:
      field: email
      function: truthy
  xquik-servers:
    description: Declare a production server.
    given: '$'
    severity: error
    then:
      field: servers
      function: truthy
  xquik-server-url:
    description: Give each server a URL.
    given: '$.servers[*]'
    severity: error
    then:
      field: url
      function: truthy
  xquik-tags:
    description: Define shared operation tags.
    given: '$'
    severity: info
    then:
      field: tags
      function: truthy
  xquik-paths:
    description: Publish API paths.
    given: '$'
    severity: error
    then:
      field: paths
      function: truthy
  xquik-operation-summary:
    description: Summarize every operation.
    given: '$.paths[*][get,post,put,patch,delete]'
    severity: error
    then:
      field: summary
      function: truthy
  xquik-operation-id:
    description: Identify every operation.
    given: '$.paths[*][get,post,put,patch,delete]'
    severity: error
    then:
      field: operationId
      function: truthy
  xquik-operation-tags:
    description: Group every operation.
    given: '$.paths[*][get,post,put,patch,delete]'
    severity: error
    then:
      field: tags
      function: truthy
  xquik-operation-responses:
    description: Document operation responses.
    given: '$.paths[*][get,post,put,patch,delete]'
    severity: error
    then:
      field: responses
      function: truthy
  xquik-components:
    description: Publish reusable components.
    given: '$'
    severity: info
    then:
      field: components
      function: truthy
  xquik-component-schemas:
    description: Publish reusable schemas.
    given: '$.components'
    severity: error
    then:
      field: schemas
      function: truthy
  xquik-security-schemes:
    description: Declare authentication schemes.
    given: '$.components'
    severity: error
    then:
      field: securitySchemes
      function: truthy
  xquik-security:
    description: Apply authentication requirements.
    given: '$'
    severity: error
    then:
      field: security
      function: truthy