Skip to content

Schema: Refactor declaration of codelists to match ODS JSON Schema Extension 1.0 #433

@mrshll1001

Description

@mrshll1001

We should update the syntax of how we declare closed codelists to match Open Data Services JSON Schema Extension 1.0.0. This will involve adding the values of closed codelists as enums within the Standard and removing the openCodelist property from schema properties which use codelists.

This would not affect any validation rules in the Standard, simply update the implementation of the schema to a modern syntax.

We currently use the older style of declaring closed vs open codelists e.g.

{
  "primaryGrantReason": {
    "type": "string",
    "title": "Primary Grant Reason",
    "description": "A code referring to the reason(s) for a grant to an individual. The value for this field should be drawn from the Grant to Individuals Reason codelist",
    "codelist": "grantToIndividualsReason.csv",
    "openCodelist": false
  }
}

According to the docs for the Open Data Services JSON Schema Extension, the use of openCodelist was deprecated in version 1.0.0. A codelist is considered open when the codelist property is present without a sibling enum.

This would also reduce the need to "compile" schemas, which occurs in tooling via the Compile To JSON Schema, since all this effectively does for us is create de-referenced versions of schemas where values of closed codelists are added as enum. This reduces maintenance and development complexity on tooling, since there is no need to compile the schemas to add in codelists.

All codelists currently used by 360Giving are closed codelists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions