2012-03-14 23 views
6

için örnek Json şema için patternProperties öğesini nasıl kullanacağımı gösteren bir örnek verebilirmiyim?Json Schema patternProperties

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

A ör .:

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

patternProperties bunun için doğru bir seçimdir ile başlayan "Örnek" herhangi olarak alt izin Ne json dosyası yapmak istiyorum nedir?

cevap

9
{ 
    type: 'object', 
    patternProperties: { 
    '^A': { 
     type: 'string', 
     ... 
    } 
    } 
} 
+0

Yani '^ A' sadece bir RegEx olmalıdır? ve dize eşleşmesi eşleşiyor mu? – Stephan

+0

Evet, bu doğru. – Baggz

İlgili konular