2015-10-15 34 views
0

我收到錯誤無法生成映射模板。

我的模型架構是:

{ 
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "type": "object", 
    "title": "Configuration", 
    "properties": { 
    "steps": { 
     "type": "array", 
     "items": { 
     "type": "object", 
     "properties": { 
      "ordinal": { 
      "type": "integer" 
      }, 
      "rules": { 
      "type": "array", 
      "items": { 
       "properties": { 
       "ordinal": { 
        "type": "integer" 
       }, 
       "rId": { 
        "type": "integer" 
       }, 
       "rMId": { 
        "type": "integer" 
       }, 
       "rValue": { 
        "type": "string" 
       } 
       } 
      } 
      } 
     } 
     } 
    } 
    } 
} 

回答

1

我認爲錯誤拋出,因爲你錯過了typerules。 如果你補充一點,它應該是好的。

+1

'「rules」:{「type」:「array」,'這是不對的? –

1

看起來像是錯過了一個在#/properties/steps/items/properties/rules/items

我推薦使用definitions使模式更具可讀性。它使得更容易注意到這樣的小問題。