Json Schema Example for patternProperties

can someone give me an example of how to use the patternProperties element for a json schema?

"Example" : "type" : "object", "patternProperties" : { <how do I use this> } 

What I want to do in the json file is to allow any β€œExample” subitem that starts with A for example :.

 { "Example" : { "Aaa" : { ...} } } 

has the patternProperties property the right choice for this?

+6
source share
1 answer
 { type: 'object', patternProperties: { '^A': { type: 'string', ... } } } 
+9
source

Source: https://habr.com/ru/post/910707/


All Articles