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

feat: add JSON Schema 2020-12 schemas #72

Closed
wants to merge 1 commit into from

Conversation

jeremyfiel
Copy link

closes #71

schemas/v1/schema.json Outdated Show resolved Hide resolved
@ralfhandl
Copy link
Contributor

Hi @jeremyfiel,

Thanks for contributing this!

We don't have the infrastructure in place for testing and publishing schemas, so I'll convert this PR to draft until we are ready.

@ralfhandl ralfhandl added this to the Release 1.0 milestone Oct 9, 2024
@ralfhandl ralfhandl marked this pull request as draft October 9, 2024 08:18
@jeremyfiel
Copy link
Author

jeremyfiel commented Oct 14, 2024

Per #77
updated the schema to include a validation check for action-object.

If the target selects an object node, the value of this field MUST be an object with the properties and values to merge with the selected node.


Because an array update can be of type: any, I did not include an additional validation check for that scenario outlined as a MUST.

If the target selects an array, the value of this field MUST be an entry to append to the array.

rethinking this, I don't think this is possible to enforce from the schema because the target value will always be a string. There's no way to interpret the resolved value in the schema. This is a requirement for tooling, only.

@jeremyfiel jeremyfiel force-pushed the feat/add-json-schema branch 2 times, most recently from 8e3e22d to bceb815 Compare October 17, 2024 21:38
Copy link
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

In addition to this we'll also need (not necessarily in this PR)

schemas/v1.0/schema.json Outdated Show resolved Hide resolved
@jeremyfiel
Copy link
Author

related #86

You can also validate a document individually.

```bash
node scripts/validate.mjs path/to/document/to/validate.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, forgot to copy this 🙄

Copy link
Contributor

Choose a reason for hiding this comment

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

Added: thanks for reminding me!

* add constraint for `update` scenario' -m 'rename version folder'
* update `$id` with the official release date
* add `$comment` for each section
* add schema readme.md
* remove .json file as it's auto-generated by the build
* revise target regex pattern
* update schema readme

closes OAI#71
@ralfhandl
Copy link
Contributor

@jeremyfiel Can this PR be closed in favor of #94?

And do you want to include the README.mdin #94?

@jeremyfiel
Copy link
Author

@jeremyfiel Can this PR be closed in favor of #94?

And do you want to include the README.mdin #94?

yes, can be closed and readme ported over.

@jeremyfiel jeremyfiel closed this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON Schema 2020-12 schema
2 participants