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

Validate ref #69

Merged
merged 6 commits into from
Jan 6, 2020
Merged

Validate ref #69

merged 6 commits into from
Jan 6, 2020

Conversation

vladtsir
Copy link
Contributor

Issue #, if available:
#23
Description of changes:

Everit validates $ref values, when a Schema is created using SchemaLoader$load().

This change adds loading resource definition as a schema with ResourceDefinitionSchema and JSON schema registered as meta-schemas. Unit tests show that invalid references cause SchemaLoader to throw a ValidationException.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tobywf tobywf mentioned this pull request Dec 16, 2019
@tobywf
Copy link
Contributor

tobywf commented Dec 16, 2019

this shares history with #68 - need to get that merged first. i've already closed #72 , because three dependent PRs is definitely too much. if you want to leave this one open for review, you'll have to get #68 merged first, and then merge master into this PR. do not rebase if people have already reviewed, it breaks links between comments and code because history is rewritten on rebase.

edit: fixed

pom.xml Show resolved Hide resolved
@tobywf tobywf mentioned this pull request Dec 16, 2019
@tobywf tobywf mentioned this pull request Dec 18, 2019
Copy link
Contributor

@tobywf tobywf left a comment

Choose a reason for hiding this comment

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

still going through this, looking good though

try {
return loader.load();
} catch (org.everit.json.schema.SchemaException e) {
throw new ValidationException(e.getMessage(), e.getSchemaLocation(), e);
Copy link
Contributor

Choose a reason for hiding this comment

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

could we convert the SchemaException to a org.everit.json.schema.ValidationException and keep using causingExceptions instead?

@vladtsir vladtsir requested a review from rjlohan January 2, 2020 19:32
@rjlohan rjlohan merged commit bf28c53 into aws-cloudformation:master Jan 6, 2020
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.

4 participants