aromanovich / jsl

A Python DSL for describing JSON schemas
http://jsl.readthedocs.org/
Other
218 stars 21 forks source link

Support root-level document arrays #31

Open sseg opened 7 years ago

sseg commented 7 years ago

The Document class should support creating non-object schemas. This would allow creating, for example, a root-level array schema:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Set of strings",
    "type": "array",
    "items": {"type": "string"}
}

Perhaps this can be specified using a document_type parameter of the Document.Options class. Document instantiation could dispatch to an alternate backend based on this parameter.

@aromanovich Do there already exist alternative ways of achieving the same thing? Do you think this feature would be a good fit for the library?