Harbin Institute of Technology · API Governance Rules

Harbin Institute of Technology API Rules

Spectral linting rules defining API design standards and conventions for Harbin Institute of Technology.

5 Rules warn 4 info 1
View Rules File View on GitHub

Rule Categories

hit

Rules

warn
hit-info-contact
API info object should include a contact for the HIT research portal.
$.info
warn
hit-server-scholar-host
Servers should point at the scholar.hit.edu.cn Pure web services host.
$.servers[*].url
warn
hit-apikey-security
Pure API requires api-key header security.
$.components.securitySchemes
warn
hit-list-result-shape
List result schemas should expose count and items, matching Pure conventions.
$.components.schemas[?(@property.match(/ListResult$/))].properties
info
hit-uuid-path-param
Single-resource paths use a uuid path parameter.
$.paths[?(@property.match(/{uuid}$/))]

Spectral Ruleset

Raw ↑
formats: [oas3]
rules:
  hit-info-contact:
    description: API info object should include a contact for the HIT research portal.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  hit-server-scholar-host:
    description: Servers should point at the scholar.hit.edu.cn Pure web services host.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: scholar\.hit\.edu\.cn|/ws/api
  hit-apikey-security:
    description: Pure API requires api-key header security.
    given: $.components.securitySchemes
    severity: warn
    then:
      field: apiKey
      function: truthy
  hit-list-result-shape:
    description: List result schemas should expose count and items, matching Pure conventions.
    given: $.components.schemas[?(@property.match(/ListResult$/))].properties
    severity: warn
    then:
    - field: count
      function: truthy
    - field: items
      function: truthy
  hit-uuid-path-param:
    description: Single-resource paths use a uuid path parameter.
    given: $.paths[?(@property.match(/{uuid}$/))]
    severity: info
    then:
      function: truthy