You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I added a malformed schema block, that has a malformed cfn-cli generate crashes. This issue is also not picked up by cfn-cli validate which also crashed.
(NOTE: #/definitions/properties was a malformed JSON pointer in my schema)
[2019-08-28T18:38:42Z] DEBUG - Unhandled exception
Traceback (most recent call last):
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/jsonschema/validators.py", line 776, in resolve_fragment
document = document[part]
KeyError: 'definitions'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/cli.py", line 95, in main
args.command(args)
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/validate.py", line 14, in validate
project.load()
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/project.py", line 202, in load
self.load_schema()
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/project.py", line 165, in load_schema
self.schema = load_resource_spec(f)
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/data_loaders.py", line 116, in load_resource_spec
inlined = inliner.inline()
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 85, in inline
self._walk_schema()
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 27, in _walk_schema
self._walk(self.schema, (BASE,))
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 52, in _walk
self._walk(value, old_path + (key,))
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 52, in _walk
self._walk(value, old_path + (key,))
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 52, in _walk
self._walk(value, old_path + (key,))
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/rpdk/core/jsonutils/inliner.py", line 39, in _walk
url, resolved = self.resolve(value)
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/jsonschema/validators.py", line 734, in resolve
return url, self._remote_cache(url)
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/jsonschema/validators.py", line 746, in resolve_from_url
return self.resolve_fragment(document, fragment)
File "/Users/.../Desktop/CloudFormation/env/lib/python3.7/site-packages/jsonschema/validators.py", line 779, in resolve_fragment
"Unresolvable JSON pointer: %r" % fragment
jsonschema.exceptions.RefResolutionError: Unresolvable JSON pointer: 'definitions/properties'```
The text was updated successfully, but these errors were encountered:
I think this is related to #66 and aws-cloudformation/cloudformation-resource-schema#23. It would be good to close on this issue. I'm tempted to use something like jsonref to resolve all references before we do anything to check for this kind of situation. but the root cause is again that we are validating the schema as data, not as a schema.
When I added a malformed schema block, that has a malformed
cfn-cli generate
crashes. This issue is also not picked up bycfn-cli validate
which also crashed.(NOTE:
#/definitions/properties
was a malformed JSON pointer in my schema)The text was updated successfully, but these errors were encountered: