json.net - object reuse and composition in json schemas -


i have json blob looks this;

{      "objecta":       {           "object1": {fields},           "object2": {fields},           "object3": {fields}       },       "objectb":       {           "object1": {fields},           "object2": {fields},           "object3": {fields}       } } 

is there way can define object's 1, 2 , 3 once , reuse them within schema? can done json schema? i'd write it's c# equivalent numbered objects defined once , letter objects composed of them.

edit: clarification i'm trying correct existing schema. schema defines numbered objects in every letter object though have exact same definition.

i found solution in docs.

http://json-schema.org/latest/json-schema-core.html#anchor7

schemas can have sub schemas. code looks like;

  "objectb":   {       "object1": {"title":"object1"},       "object2": {"title":"object2"},       "object3": {"title":"object3"}   } 

then out side of schema

{     "object1": {          "title":"object1",           //20 more lines of json     } } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -