Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 2 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",
roll marked this conversation as resolved.
Show resolved Hide resolved
"start": "astro dev --open --port 8080",
"update": "ncu -u",
"test": "npm run lint"
Expand Down
60 changes: 57 additions & 3 deletions profiles/source/dictionary/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,21 @@ 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:
- label
roll marked this conversation as resolved.
Show resolved Hide resolved
- value
properties:
label:
type: string
value:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: string
default:
- ""
description: Values that when encountered in the source, should be considered
Expand Down Expand Up @@ -269,6 +281,10 @@ tableSchemaFieldString:
"$ref": "#/definitions/example"
missingValues:
"$ref": "#/definitions/tableSchemaMissingValues"
categories:
"$ref": "#/definitions/tableSchemaCategoriesString"
categoriesOrder:
"$ref": "#/definitions/tableSchemaCategoriesOrder"
type:
description: The type keyword, which `MUST` be a value of `string`.
enum:
Expand Down Expand Up @@ -397,6 +413,10 @@ tableSchemaFieldInteger:
"$ref": "#/definitions/example"
missingValues:
"$ref": "#/definitions/tableSchemaMissingValues"
categories:
"$ref": "#/definitions/tableSchemaCategoriesString"
roll marked this conversation as resolved.
Show resolved Hide resolved
categoriesOrder:
"$ref": "#/definitions/tableSchemaCategoriesOrder"
type:
description: The type keyword, which `MUST` be a value of `integer`.
enum:
Expand Down Expand Up @@ -1363,3 +1383,37 @@ 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:
- label
roll marked this conversation as resolved.
Show resolved Hide resolved
- 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)

label:
type: string
value:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: string
tableSchemaCategoriesInteger:
anyOf:
- type: array
items:
type: integer
- type: array
items:
type: object
required:
- label
roll marked this conversation as resolved.
Show resolved Hide resolved
- value
properties:
label:
type: string
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?

tableSchemaCategoriesOrder:
roll marked this conversation as resolved.
Show resolved Hide resolved
type: boolean
Loading