How to use definitions in JSON schema (draft-04)

后端 未结 2 864
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 08:01

The rest service response I am working with is similar to following example, I have only included 3 fields here but there are many more:

{
    \"results\": [         


        
2条回答
  •  执念已碎
    2020-11-28 08:29

    Sorry,

    I don't get the point. The question is about the 'dependencies' keyword which is part of the last JSON Schema specification, right?

    I do not find 'dependencies' in the accepted answer (?)

    It is briefly explained in the last draft. But http://usingjsonschema.com explained both property and definition dependencies in the book:

    http://usingjsonschema.com/assets/UsingJsonSchema_20140814.pdf

    start at page 29 (see, explained at page 30)

    "dependencies": {
         "shipTo":["shipAddress"],
         "loyaltyId":["loyaltyBonus"]
    }
    

提交回复
热议问题