Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Updated the profiles to reflect categories and labeled missingness #70

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"npm": "^10.0.0"
},
"scripts": {
"build": "astro build && node profiles/build.js",
"build": "astro build && npm run profiles",
"clean": "find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' +",
"format": "eslint --fix . && prettier --write .",
"generate": "astro sync",
"lint": "eslint . && prettier --check .",
"preview": "astro preview --port 8080",
"profiles": "node profiles/build.js",
"start": "astro dev --open --port 8080",
"update": "ncu -u",
"test": "npm run lint"
Expand Down
57 changes: 54 additions & 3 deletions profiles/source/dictionary/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,20 @@ tableSchemaFalseValues:
type: string
default: ["false", "False", "FALSE", "0"]
tableSchemaMissingValues:
type: array
items:
type: string
anyOf:
- type: array
items:
type: string
- type: array
items:
type: object
required:
- value
properties:
value:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: string
label:
type: string
default:
- ""
description: Values that when encountered in the source, should be considered
Expand Down Expand Up @@ -269,6 +280,10 @@ tableSchemaFieldString:
"$ref": "#/definitions/example"
missingValues:
"$ref": "#/definitions/tableSchemaMissingValues"
categories:
"$ref": "#/definitions/tableSchemaCategoriesString"
categoriesOrdered:
"$ref": "#/definitions/tableSchemaCategoriesOrdered"
type:
description: The type keyword, which `MUST` be a value of `string`.
enum:
Expand Down Expand Up @@ -397,6 +412,10 @@ tableSchemaFieldInteger:
"$ref": "#/definitions/example"
missingValues:
"$ref": "#/definitions/tableSchemaMissingValues"
categories:
"$ref": "#/definitions/tableSchemaCategoriesInteger"
categoriesOrdered:
"$ref": "#/definitions/tableSchemaCategoriesOrdered"
type:
description: The type keyword, which `MUST` be a value of `integer`.
enum:
Expand Down Expand Up @@ -1363,3 +1382,35 @@ tableSchemaGroupChar:
type: string
title: groupChar
description: A string whose value is used to group digits within the number. This property does not have a default value. A common value is `,` e.g. '100,000'.
tableSchemaCategoriesString:
anyOf:
- type: array
items:
type: string
- type: array
items:
type: object
required:
- value
properties:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure. Defining the properties (value, label) doesn't restrict publishers to add more properties (e.g. description), correct?

Copy link
Member Author

@roll roll Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all the object are open for custom props unless it has additionalProperties: false (in-general that was the idea of an "open" to custom props specs)

value:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: string
label:
type: string
tableSchemaCategoriesInteger:
anyOf:
- type: array
items:
type: integer
- type: array
items:
type: object
required:
- value
properties:
value:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: integer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khusmann do I understand correctly that for an integer field, defining value in categories as something other than an integer, it would have to generate a validation error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is this is the point of the type-based version (moving it to the logical level). Am I correct?

label:
type: string
tableSchemaCategoriesOrdered:
type: boolean
Loading