djvi
djvi copied to clipboard
Support for definitions?
The schema we are working with places everything under the definitions keyword as follows:
const testSchema = { "id": "#", "type": "object", "definitions": { "fields": { "type": "object", "properties": { "title": { "type": "string", "default": "Example" }, "description": { "type": "string" } } } }, "allOf": { $ref: "#/definitions/fields" } }; var env = new djvi(); env.addSchema('test', testSchema); this.model = env.instance('test#', false);
Unfortunately, this generates an empty object? Are definitions not supported?
@skidvd It supports $ref
as well as the reference resolution. But it's implementation it is a bit old, I've done big resolution refactoring within the djv
package - https://github.com/korzio/djv/blob/master/lib/utils/state.js#L123, but it is not here unfortunately. I'll check what's going on in your example though. Not sure when exactly :(
Thanks for the report!