Coresignal · API Governance Rules

Coresignal API Rules

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

7 Rules error 5 warn 2
View Rules File View on GitHub

Rule Categories

coresignal

Rules

error
coresignal-jobs-server-https
Servers must use HTTPS.
$.servers[*].url
error
coresignal-jobs-base-url
Base URL must reference api.coresignal.com/cdapi/v2/multi_source_jobs.
$.servers[*].url
error
coresignal-jobs-apikey
API must use apikey header authentication.
$.components.securitySchemes.apiKey.name
warn
coresignal-jobs-search-paths
API should expose filter and Elasticsearch DSL search endpoints.
$.paths
error
coresignal-jobs-operation-id
Operations must define an operationId.
$.paths.*[get,post]
error
coresignal-jobs-operation-tags
Operations must define tags.
$.paths.*[get,post]
warn
coresignal-jobs-date-format
Date fields should use ISO 8601 date-time format.
$.components.schemas.Job.properties.date_posted

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://docs.coresignal.com/multi-source-jobs-api/
rules:
  coresignal-jobs-server-https:
    description: Servers must use HTTPS.
    given: "$.servers[*].url"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  coresignal-jobs-base-url:
    description: Base URL must reference api.coresignal.com/cdapi/v2/multi_source_jobs.
    given: "$.servers[*].url"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "api.coresignal.com/cdapi/v2/multi_source_jobs"
  coresignal-jobs-apikey:
    description: API must use apikey header authentication.
    given: "$.components.securitySchemes.apiKey.name"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^apikey$"
  coresignal-jobs-search-paths:
    description: API should expose filter and Elasticsearch DSL search endpoints.
    given: "$.paths"
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /search/filter
            - /search/es_dsl
            - /collect/{id}
  coresignal-jobs-operation-id:
    description: Operations must define an operationId.
    given: "$.paths.*[get,post]"
    severity: error
    then:
      field: operationId
      function: truthy
  coresignal-jobs-operation-tags:
    description: Operations must define tags.
    given: "$.paths.*[get,post]"
    severity: error
    then:
      field: tags
      function: truthy
  coresignal-jobs-date-format:
    description: Date fields should use ISO 8601 date-time format.
    given: "$.components.schemas.Job.properties.date_posted"
    severity: warn
    then:
      field: format
      function: pattern
      functionOptions:
        match: "date-time"