djvi icon indicating copy to clipboard operation
djvi copied to clipboard

Support for definitions?

Open skidvd opened this issue 7 years ago • 1 comments

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 avatar Feb 01 '18 15:02 skidvd

@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!

korzio avatar Feb 03 '18 17:02 korzio