Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Ignore $ref siblings & abort on infinite-loop references (#437)
* Add tests for $ref enforcement * Overriding schema properties from $ref is not allowed From the spec [1]: An object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref" property MUST be a URI Reference. Resolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object MUST be ignored. [1] https://tools.ietf.org/html/draft-wright-json-schema-01#section-8 * Add test for infinite-loop circular reference * Return dereferenced schema directly and check for infinite-loops Schemas containing $ref MUST ignore all other properties, so just return the reference target directly. Because some circular references may result in an infinite loop, keep track of the objects that have been dereferenced during the current call to SchemaStorage and abort if the same object is encountered more than once. * Code style fix (remove blank line)
- Loading branch information