Yonsei University · API Governance Rules

Yonsei University API Rules

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

6 Rules error 1 warn 4 info 1
View Rules File View on GitHub

Rule Categories

yonsei

Rules

warn
yonsei-info-contact
API info object should include a contact for the Yonsei Pure API.
$.info
error
yonsei-server-https
All servers must use HTTPS (the Yonsei Pure instance is served over TLS).
$.servers[*].url
warn
yonsei-api-key-security
Pure API uses an api-key security scheme; it must be defined.
$.components.securitySchemes
warn
yonsei-operation-tags
Every operation should be tagged so research-information resources are grouped.
$.paths[*][get,put,post,delete]
warn
yonsei-uuid-on-core-objects
Core Pure objects (ResearchOutput, Person, Project) expose a uuid identifier.
$.components.schemas.ResearchOutput.properties$.components.schemas.Person.properties$.components.schemas.Project.properties
info
yonsei-pure-id-integer
The pureId surrogate key, when present, should be an integer.
$.components.schemas[*].properties.pureId

Spectral Ruleset

Raw ↑
rules:

  yonsei-info-contact:
    description: API info object should include a contact for the Yonsei Pure API.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy

  yonsei-server-https:
    description: All servers must use HTTPS (the Yonsei Pure instance is served over TLS).
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  yonsei-api-key-security:
    description: Pure API uses an api-key security scheme; it must be defined.
    given: $.components.securitySchemes
    severity: warn
    then:
      field: api-key
      function: truthy

  yonsei-operation-tags:
    description: Every operation should be tagged so research-information resources are grouped.
    given: $.paths[*][get,put,post,delete]
    severity: warn
    then:
      field: tags
      function: truthy

  yonsei-uuid-on-core-objects:
    description: Core Pure objects (ResearchOutput, Person, Project) expose a uuid identifier.
    given:
      - $.components.schemas.ResearchOutput.properties
      - $.components.schemas.Person.properties
      - $.components.schemas.Project.properties
    severity: warn
    then:
      field: uuid
      function: truthy

  yonsei-pure-id-integer:
    description: The pureId surrogate key, when present, should be an integer.
    given: $.components.schemas[*].properties.pureId
    severity: info
    then:
      field: type
      function: pattern
      functionOptions:
        match: "^integer$"