jsonschema - what is the difference between properties and patternProperties in json schema? -


for following json string :

{     "abc" : 123,     "def" : 345 } 

the following schema considers valid :

{     "$schema": "http://json-schema.org/draft-03/schema#",     "title": "my schema",     "description": "blah",     "type": "object",     "patternproperties": {         ".+": {             "type": "number"         }     } } 

however, changing the patternproperties properties still considers valid. then, difference between these 2 tags?

for schema above properties should number. data invalid:

{ a: 'a' } 

if replace patternproperties properties property '.+' should number. other properties can anything. invalid:

{ '.+': 'a' } 

this valid:

{ a: 'a' } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -