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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -