Resend · API Governance Rules

Resend API Rules

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

11 Rules error 3 warn 6 info 2
View Rules File View on GitHub

Rule Categories

resend

Rules

error
resend-operation-id
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
resend-operation-summary
All operations must have a summary in Title Case.
$.paths[*][get,post,put,patch,delete]
warn
resend-bearer-auth
All operations should use Bearer token authentication.
$.paths[*][*]
error
resend-response-200-or-201
All operations should have a 200 or 201 success response.
$.paths[*][get,post,put,patch,delete].responses
warn
resend-request-body-post
POST operations that create resources should have a request body.
$.paths[*].post
info
resend-path-resource-id
Path parameters for resource IDs should use snake_case with _id suffix.
$.paths[*].parameters[?(@.in == 'path')]
warn
resend-path-plural-nouns
Collection paths should use plural nouns.
$.paths[?([email protected](/{.*}/))][*]~
warn
resend-tags-title-case
All tags must use Title Case.
$.tags[*].name
warn
resend-operation-tags
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
resend-response-schema
Success responses should reference a schema.
$.paths[*][*].responses[200,201].content.application/json.schema
info
resend-rate-limit-documented
API should document rate limiting behavior.
$.info

Spectral Ruleset

Raw ↑
rules:
  resend-operation-id:
    description: All operations must have an operationId.
    message: Operation is missing operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy

  resend-operation-summary:
    description: All operations must have a summary in Title Case.
    message: Operation is missing a summary.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy

  resend-bearer-auth:
    description: All operations should use Bearer token authentication.
    message: Operation should reference bearerAuth security scheme.
    severity: warn
    given: $.paths[*][*]
    then:
      field: security
      function: schema
      functionOptions:
        schema:
          type: array

  resend-response-200-or-201:
    description: All operations should have a 200 or 201 success response.
    message: Operation should define a success response.
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ['200']
            - required: ['201']

  resend-request-body-post:
    description: POST operations that create resources should have a request body.
    message: POST operation should include a request body.
    severity: warn
    given: $.paths[*].post
    then:
      field: requestBody
      function: truthy

  resend-path-resource-id:
    description: Path parameters for resource IDs should use snake_case with _id suffix.
    message: Resource ID parameter should follow snake_case _id naming pattern.
    severity: info
    given: $.paths[*].parameters[?(@.in == 'path')]
    then:
      field: name
      function: pattern
      functionOptions:
        match: '^[a-z][a-z0-9_]*$'

  resend-path-plural-nouns:
    description: Collection paths should use plural nouns.
    message: Collection endpoint path should use a plural noun.
    severity: warn
    given: $.paths[?([email protected](/{.*}/))][*]~
    then:
      function: pattern
      functionOptions:
        match: '^\/(emails|domains|api-keys|audiences|broadcasts)'

  resend-tags-title-case:
    description: All tags must use Title Case.
    message: Tag name should use Title Case.
    severity: warn
    given: $.tags[*].name
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z ]*$'

  resend-operation-tags:
    description: All operations must have at least one tag.
    message: Operation is missing tags.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy

  resend-response-schema:
    description: Success responses should reference a schema.
    message: Success response should include a schema.
    severity: warn
    given: $.paths[*][*].responses[200,201].content.application/json.schema
    then:
      function: truthy

  resend-rate-limit-documented:
    description: API should document rate limiting behavior.
    message: API info should reference rate limiting documentation.
    severity: info
    given: $.info
    then:
      field: description
      function: truthy