trello · API Governance Rules

trello API Rules

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

20 Rules error 4 warn 14 info 2
View Rules File View on GitHub

Rule Categories

no operation path query schema servers trello

Rules

warn
trello-operation-id-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
trello-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
error
trello-security-defined
All operations must define security requirements
$.paths[*][get,post,put,patch,delete]
error
trello-response-200-get
All GET operations must define a 200 response
$.paths[*].get
warn
trello-tag-defined
All operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
trello-api-key-auth
Trello uses API key and token query parameter authentication
$.components.securitySchemes
warn
trello-path-kebab-case
API paths should use kebab-case
$.paths[*]~
warn
trello-response-400-defined
Operations with request bodies should define a 400 response
$.paths[*][post,put,patch]
warn
trello-delete-response
DELETE operations should return 200 or 204
$.paths[*].delete
warn
trello-post-request-body
POST operations that create resources should define a request body
$.paths[*].post
error
trello-no-query-strings-in-path
Query string parameters must not appear in path definitions
$.paths[*]~
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the trello.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be snake_case (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be snake_case (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 snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
operation-documents-401
Operations should document a 401 response (documented on 100% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
operation-documents-404
Operations should document a 404 response (documented on 88% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# trello — 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)
#   - servers-expected-domain: 1/1 servers on trello.com
#   - path-params-casing: snake @ 90% (n=101)
#   - query-params-casing: snake @ 69% (n=201)
#   - operationid-casing: camel @ 99% (n=101)
#   - schema-names-casing: pascal @ 100% (n=20)
#   - schema-properties-casing: snake @ 61% (n=168)
#   - security: global (root) — NOT emitting operation-security-required
#   - operation-documents-401: 100% adherence
#   - operation-documents-404: 88% adherence
#   - pagination params observed: ['limit']
#   - merge: kept 11 existing, added 9 measured, upgraded 0
#   - added: servers-https-only, servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, operation-documents-401, operation-documents-404, no-empty-descriptions
extends:
  - spectral:oas
rules:
  trello-operation-id-camel-case:
    description: Operation IDs must use camelCase
    message: Operation ID '{{value}}' must use camelCase
    severity: warn
    given: $.paths[*][*].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  trello-summary-title-case:
    description: Operation summaries must use Title Case
    message: Summary '{{value}}' should use Title Case
    severity: warn
    given: $.paths[*][*].summary
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9 /()+&-]*$
  trello-security-defined:
    description: All operations must define security requirements
    message: Operation must define security requirements
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: security
      function: defined
  trello-response-200-get:
    description: All GET operations must define a 200 response
    message: GET operation must define a 200 success response
    severity: error
    given: $.paths[*].get
    then:
      field: responses.200
      function: defined
  trello-tag-defined:
    description: All operations must have at least one tag
    message: Operation must include at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: defined
  trello-api-key-auth:
    description: Trello uses API key and token query parameter authentication
    message: Trello auth uses apiKey and token query parameters
    severity: info
    given: $.components.securitySchemes
    then:
      function: defined
  trello-path-kebab-case:
    description: API paths should use kebab-case
    message: Path should use kebab-case
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9][a-z0-9-]*(/[a-z0-9][a-z0-9-]*|/\{[a-zA-Z][a-zA-Z0-9]*\})*)+$
  trello-response-400-defined:
    description: Operations with request bodies should define a 400 response
    message: POST/PUT/PATCH operation should define 400 Bad Request
    severity: warn
    given: $.paths[*][post,put,patch]
    then:
      field: responses.400
      function: defined
  trello-delete-response:
    description: DELETE operations should return 200 or 204
    message: DELETE operation should define a success response
    severity: warn
    given: $.paths[*].delete
    then:
      function: defined
  trello-post-request-body:
    description: POST operations that create resources should define a request body
    message: POST operation should include a requestBody
    severity: warn
    given: $.paths[*].post
    then:
      field: requestBody
      function: defined
  trello-no-query-strings-in-path:
    description: Query string parameters must not appear in path definitions
    message: Path must not contain query strings
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: \?
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-expected-domain:
    description: Server URLs should be on the trello.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: trello\.com
  path-params-casing:
    description: Path parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: snake
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  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 snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  operation-documents-401:
    description: Operations should document a 401 response (documented on 100% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  operation-documents-404:
    description: Operations should document a 404 response (documented on 88% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '404'
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy