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

Json format 2.0 #6

Merged
merged 7 commits into from
Jan 24, 2024
Merged

Json format 2.0 #6

merged 7 commits into from
Jan 24, 2024

Conversation

shaselton-usds
Copy link
Collaborator

Incorporating JSON v2.0 validation into the WIP on tall-format-2.0.

These changes now support the v2.0 JSON schema requirements.

@@ -18,6 +19,8 @@ export async function validateJson(
): Promise<ValidationResult> {
if (version === "v1.1") {
return JsonValidatorOneOne.validateJson(jsonInput, options)
} else if (version === "v2.0") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mint-thompson I'm thinking that we'll probably want to update this to support major, minor, and patch versioning, but keeping it consistent with the previous implementation for now.

src/versions/2.0/json.ts Show resolved Hide resolved
src/versions/2.0/json.ts Outdated Show resolved Hide resolved
@@ -213,6 +274,7 @@ export async function validateJson(
if (typeof key === "string") {
metadata[key] = value
} else {
// is this where I need to put another check for the modifier information?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is the right spot for that. These checks that collect values into the local metadata object may have to get updated, since modifiers are part of the METADATA_SCHEMA. It might be useful for us to take a closer look at some of this code to make sure that we get the right approach here. Then, we can add some modifiers to the test fixtures.

@shaselton-usds shaselton-usds merged commit 3050c12 into tall-format-2.0 Jan 24, 2024
2 checks passed
@shaselton-usds shaselton-usds deleted the json-format-2.0 branch February 26, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants