BeyondTrust · API Governance Rules

BeyondTrust API Rules

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

29 Rules error 11 warn 14 info 4
View Rules File View on GitHub

Rule Categories

credential error http info no openapi operation parameter path query response schema security servers

Rules

warn
info-title-prefix
API title should start with "BeyondTrust"
$.info.title
error
info-description-required
API info must have a description
$.info
error
info-version-required
API must specify a version
$.info
warn
openapi-version-3
Should use OpenAPI 3.0.x
$.openapi
error
servers-defined
At least one server must be defined
$
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries should start with "BeyondTrust"
$.paths[*][get,post,put,patch,delete].summary
error
operation-id-required
All operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-id-camel-case
operationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Operations must have tags
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Operations should have descriptions
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
Operations must define a success response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Response descriptions are required
$.paths[*][get,post,put,patch,delete].responses[*]
info
response-401-for-auth
Auth endpoints should return 401 on failure
$.paths[*][post].responses
warn
schema-description-required
Component schemas should have descriptions
$.components.schemas[*]
info
schema-pascal-case-names
Schema names should use PascalCase
$.components.schemas
error
security-schemes-defined
Security schemes must be defined
$.components
warn
security-global-defined
Global security should be defined
$
error
http-get-no-body
GET operations should not have request bodies
$.paths[*].get
warn
http-delete-no-body
DELETE operations should not have request bodies
$.paths[*].delete
error
credential-endpoint-secured
Credential retrieval endpoints must require authentication
$.paths['/requests/{requestId}/credentials'].get
warn
no-empty-descriptions
Descriptions should not be empty
$..description
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
info
query-params-casing
Query parameters should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be PascalCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas

Spectral Ruleset

Raw ↑
# beyondtrust — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 100% of servers already https (error)
#   - path-params-casing: camel @ 67% (n=6)
#   - query-params-casing: camel @ 50% (n=4)
#   - operationid-casing: camel @ 100% (n=14)
#   - schema-names-casing: pascal @ 100% (n=12)
#   - schema-properties-casing: pascal @ 68% (n=62)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - merge: kept 23 existing, added 6 measured, upgraded 0
#   - added: servers-https-only, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, error-schema-defined
extends:
  - spectral:oas
rules:
  info-title-prefix:
    description: API title should start with "BeyondTrust"
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^BeyondTrust
  info-description-required:
    description: API info must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API must specify a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: Should use OpenAPI 3.0.x
    severity: warn
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-defined:
    description: At least one server must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  operation-summary-required:
    description: All operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-summary-prefix:
    description: Operation summaries should start with "BeyondTrust"
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^BeyondTrust
  operation-id-required:
    description: All operations must have operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-id-camel-case:
    description: operationId should use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]+$
  operation-tags-required:
    description: Operations must have tags
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  operation-description-required:
    description: Operations should have descriptions
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  parameter-description-required:
    description: Parameters must have descriptions
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    description: Operations must define a success response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1
  response-description-required:
    description: Response descriptions are required
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  response-401-for-auth:
    description: Auth endpoints should return 401 on failure
    severity: info
    given: $.paths[*][post].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
  schema-description-required:
    description: Component schemas should have descriptions
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-pascal-case-names:
    description: Schema names should use PascalCase
    message: Schema name '{{path}}' should use PascalCase
    severity: info
    given: $.components.schemas
    then:
      function: schema
      functionOptions:
        schema:
          type: object
  security-schemes-defined:
    description: Security schemes must be defined
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  security-global-defined:
    description: Global security should be defined
    severity: warn
    given: $
    then:
      field: security
      function: truthy
  http-get-no-body:
    description: GET operations should not have request bodies
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  http-delete-no-body:
    description: DELETE operations should not have request bodies
    severity: warn
    given: $.paths[*].delete
    then:
      field: requestBody
      function: falsy
  credential-endpoint-secured:
    description: Credential retrieval endpoints must require authentication
    severity: error
    given: $.paths['/requests/{requestId}/credentials'].get
    then:
      field: security
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 0
  no-empty-descriptions:
    description: Descriptions should not be empty
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  query-params-casing:
    description: Query parameters should be camelCase (the dominant convention in this API).
    severity: info
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: camel
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be PascalCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Za-z0-9]*$
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy