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 schema tests and official JSON Schema #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremyfiel
Copy link

includes pass and fail scenarios for Overlay schema tests.

Also includes the full schema per #72

@ralfhandl ralfhandl added this to the Release 1.0 milestone Nov 5, 2024
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
mikekistler
mikekistler previously approved these changes Nov 5, 2024
Copy link
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
Comment on lines 78 to 67
allOf:
- description: The `update` field has no impact if the `remove` field of this
action object is true.
if:
properties:
remove:
const: true
required:
- remove
then:
not:
required:
- update
Copy link
Contributor

Choose a reason for hiding this comment

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

This is stricter than the specification, which allows update together with remove: true.

I'd rather remove this, and also remove the test case fail/actions-no-update-with-remove.yaml.

Copy link
Author

Choose a reason for hiding this comment

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

i asked for clarification on this in #71

I think allowing this in the schema introduces an ambiguous implementation detail.. does the remove apply first, or the update? Specifically because the spec indicates actions should be performed in order

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's wait for the outcome of #71 then with merging this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

The schema validator we use thinks this allOf construct is invalid.

Copy link
Author

Choose a reason for hiding this comment

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

when I removed the description, i missed the array syntax was removed. That's why we have tests! 👍

tests/v1.0/fail/actions-no-update-with-remove.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
schemas/v1.0/schema.yaml Outdated Show resolved Hide resolved
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.

Almost there, only minor nits.

Thank you!

tests/v1.0/fail/extends-invalid-type.yaml Outdated Show resolved Hide resolved
tests/v1.0/fail/info-missing-title.yaml Outdated Show resolved Hide resolved
schemas/v1.0/readme.md Outdated Show resolved Hide resolved
@ralfhandl
Copy link
Contributor

@jeremyfiel Could you please add a description to one of the Action Objects?

That's the only part of the schema that is not yet tested.

@jeremyfiel jeremyfiel force-pushed the schema-test branch 2 times, most recently from dc198e7 to 5517ebc Compare November 12, 2024 14:58
@jeremyfiel
Copy link
Author

should be all covered now

@ralfhandl
Copy link
Contributor

should be all covered now

Sorry, should have been more precise: please add to a "pass" test case, the "fail" ones don't count into the schema coverage.

* fixup `target` json path
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.

3 participants