singer-io / singer-python

Writes the Singer format from Python
https://singer.io
Apache License 2.0
537 stars 129 forks source link

Support pattern properties in object schemas #92

Closed dmosorast closed 5 years ago

dmosorast commented 5 years ago

JSON Schema supports object schemas having the keys additionalProperties and patternProperties described in the Draft 4 validation document here.

Maintained

Added

patternProperties

PatternProperties are a JSON object of the form {"regex_pattern": {...schema...}}. For example, a simple "catch-all" schema would look like this:

{
    "type": "object",
    "patternProperties": {
        ".+": {},
        ...
    }
}

This is useful in the event that you want the schema to validate against all keys, but override using properties for more specific types (like date-times).

Principles