University of Warsaw · API Governance Rules

University of Warsaw API Rules

Spectral linting rules defining API design standards and conventions for University of Warsaw.

7 Rules error 1 warn 4 info 2
View Rules File View on GitHub

Rule Categories

usos

Rules

warn
usos-info-contact
USOS API spec should declare a contact.
$.info
error
usos-server-https
USOS API servers must use HTTPS even though base_url advertises http.
$.servers[*].url
warn
usos-operation-external-docs
Each USOS operation should link back to its reference page.
$.paths[*][get]
info
usos-fields-parameter
USOS read operations that return field-selectable objects should expose a "fields" selector parameter.
$.paths[*][get].parameters
warn
usos-format-parameter-enum
The format parameter should be limited to supported output formats.
$..parameters[?(@.name=='format')].schema
warn
usos-error-envelope
An Error schema with error/message fields should be defined.
$.components.schemas.Error.properties
info
usos-langdict-defined
A LangDict schema should be defined for localized strings.
$.components.schemas

Spectral Ruleset

Raw ↑
extends: []
formats:
  - oas3
documentationUrl: https://usosapps.uw.edu.pl/developers/api/
rules:
  usos-info-contact:
    description: USOS API spec should declare a contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy

  usos-server-https:
    description: USOS API servers must use HTTPS even though base_url advertises http.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://'

  usos-operation-external-docs:
    description: Each USOS operation should link back to its reference page.
    given: $.paths[*][get]
    severity: warn
    then:
      field: externalDocs
      function: truthy

  usos-fields-parameter:
    description: >-
      USOS read operations that return field-selectable objects should expose a
      "fields" selector parameter.
    given: $.paths[*][get].parameters
    severity: info
    then:
      function: truthy

  usos-format-parameter-enum:
    description: The format parameter should be limited to supported output formats.
    given: $..parameters[?(@.name=='format')].schema
    severity: warn
    then:
      field: enum
      function: truthy

  usos-error-envelope:
    description: An Error schema with error/message fields should be defined.
    given: $.components.schemas.Error.properties
    severity: warn
    then:
      field: error
      function: truthy

  usos-langdict-defined:
    description: A LangDict schema should be defined for localized strings.
    given: $.components.schemas
    severity: info
    then:
      field: LangDict
      function: truthy