Dartmouth College · API Governance Rules

Dartmouth College API Rules

Spectral linting rules defining API design standards and conventions for Dartmouth College.

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

Rule Categories

dartmouth

Rules

error
dartmouth-info-title
API must declare an info.title.
$.info
error
dartmouth-info-version
API must declare an info.version.
$.info
warn
dartmouth-has-servers
A server URL should be declared so the API is callable.
$
warn
dartmouth-paths-search-prefix
ArcGIS Hub Search paths used by the Dartmouth Open Data portal are versioned under /api/search/v1.
$.paths[*]~
warn
dartmouth-operation-200
Read operations should document a 200 response.
$.paths[*].get.responses
info
dartmouth-feature-collection-type
Item collection responses follow the GeoJSON FeatureCollection shape.
$.components.schemas.OgcItemResponseDto.properties.type.enum

Spectral Ruleset

Raw ↑
formats:
  - oas3
rules:
  dartmouth-info-title:
    description: API must declare an info.title.
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  dartmouth-info-version:
    description: API must declare an info.version.
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  dartmouth-has-servers:
    description: A server URL should be declared so the API is callable.
    severity: warn
    given: $
    then:
      field: servers
      function: truthy
  dartmouth-paths-search-prefix:
    description: ArcGIS Hub Search paths used by the Dartmouth Open Data portal are versioned under /api/search/v1.
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: "^/api/search/v1"
  dartmouth-operation-200:
    description: Read operations should document a 200 response.
    severity: warn
    given: $.paths[*].get.responses
    then:
      field: "200"
      function: truthy
  dartmouth-feature-collection-type:
    description: Item collection responses follow the GeoJSON FeatureCollection shape.
    severity: info
    given: $.components.schemas.OgcItemResponseDto.properties.type.enum
    then:
      function: truthy