Jobber · API Governance Rules

Jobber API Rules

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

6 Rules error 3 warn 3
View Rules File View on GitHub

Rule Categories

jobber

Rules

warn
jobber-info-contact-email
Jobber API specs must include the official api-support contact email.
$.info.contact
error
jobber-server-base-url
Production server must point to https://api.getjobber.com.
$.servers[*]
error
jobber-graphql-endpoint
There must be exactly one POST /api/graphql operation.
$.paths
warn
jobber-graphql-version-header
GraphQL operation should declare the X-JOBBER-GRAPHQL-VERSION header parameter.
$.paths['/api/graphql'].post.parameters[?(@.name=='X-JOBBER-GRAPHQL-VERSION')]
error
jobber-bearer-security
Bearer security scheme is required for the GraphQL endpoint.
$.components.securitySchemes
warn
jobber-summaries-title-case
Operation summaries should use Title Case.
$.paths..[get,post,put,patch,delete].summary

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  jobber-info-contact-email:
    description: Jobber API specs must include the official api-support contact email.
    given: $.info.contact
    severity: warn
    then:
      field: email
      function: pattern
      functionOptions:
        match: '^api-support@getjobber\.com$'
  jobber-server-base-url:
    description: Production server must point to https://api.getjobber.com.
    given: $.servers[*]
    severity: error
    then:
      field: url
      function: pattern
      functionOptions:
        match: '^https://api\.getjobber\.com'
  jobber-graphql-endpoint:
    description: There must be exactly one POST /api/graphql operation.
    given: $.paths
    severity: error
    then:
      field: /api/graphql.post
      function: truthy
  jobber-graphql-version-header:
    description: GraphQL operation should declare the X-JOBBER-GRAPHQL-VERSION header parameter.
    given: $.paths['/api/graphql'].post.parameters[?(@.name=='X-JOBBER-GRAPHQL-VERSION')]
    severity: warn
    then:
      function: truthy
  jobber-bearer-security:
    description: Bearer security scheme is required for the GraphQL endpoint.
    given: $.components.securitySchemes
    severity: error
    then:
      field: bearerAuth
      function: truthy
  jobber-summaries-title-case:
    description: Operation summaries should use Title Case.
    given: $.paths..[get,post,put,patch,delete].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][A-Za-z0-9]*)(\s[A-Z][A-Za-z0-9]*)*$'