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
properties takes precedence
An empty properties and patternProperties is treated as an empty schema and validates against all
Regex ordering cannot be guaranteed (since the JSON Schema spec says "object" explicitly), so regexes should be distinct as possible for mixing types, to be deterministic
JSON Schema supports object schemas having the keys
additionalProperties
andpatternProperties
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: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
properties
takes precedenceproperties
andpatternProperties
is treated as an empty schema and validates against all