-
Notifications
You must be signed in to change notification settings - Fork 38
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
Validate ref #69
Conversation
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 edit: fixed |
src/test/java/software/amazon/cloudformation/resource/ValidatorRefResolutionTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
src/test/java/software/amazon/cloudformation/resource/ValidatorTest.java
Outdated
Show resolved
Hide resolved
src/test/java/software/amazon/cloudformation/resource/ValidatorRefResolutionTests.java
Outdated
Show resolved
Hide resolved
src/test/java/software/amazon/cloudformation/resource/ValidatorRefResolutionTests.java
Outdated
Show resolved
Hide resolved
src/main/java/software/amazon/cloudformation/resource/Validator.java
Outdated
Show resolved
Hide resolved
try { | ||
return loader.load(); | ||
} catch (org.everit.json.schema.SchemaException e) { | ||
throw new ValidationException(e.getMessage(), e.getSchemaLocation(), e); |
There was a problem hiding this comment.
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?
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.