Lund University · API Governance Rules

Lund University API Rules

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

5 Rules warn 3 info 2
View Rules File View on GitHub

Rule Categories

definition no property schema

Rules

warn
schema-declares-$schema
Every JSON Schema document should declare its $schema (draft).
$
info
schema-has-title
JSON Schema documents should declare a title.
$
info
property-name-casing
Schema properties should be snake_case (the dominant convention in this API).
$..properties
warn
definition-name-casing
Schema definitions names should be snake_case (the dominant convention in this API).
$..definitions
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# lund — JSON Schema Spectral ruleset (strengthened)
# Plain Spectral. Rules measured from this provider's own JSON Schema
# conventions by strengthen_jsonschema.py, then self-validated against them.
#
# Provenance:
#   - schema-declares-$schema: 2/2 roots
#   - schema-has-title: 2/2 roots
#   - property-name-casing: snake @ 88% (n=142)
#   - def-name-casing: snake @ 100% (n=8)
rules:
  schema-declares-$schema:
    description: Every JSON Schema document should declare its $schema (draft).
    severity: warn
    given: $
    then:
      field: $schema
      function: truthy
  schema-has-title:
    description: JSON Schema documents should declare a title.
    severity: info
    given: $
    then:
      field: title
      function: truthy
  property-name-casing:
    description: Schema properties should be snake_case (the dominant convention in this API).
    severity: info
    given: $..properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  definition-name-casing:
    description: Schema definitions names should be snake_case (the dominant convention in this API).
    severity: warn
    given: $..definitions
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy