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
Post a Comment