* Add replaceOnChange to schema * replaceOnChange at generate time for resources * ReplaceOnChanges sees through optional types * Correctly deal with map,array,object,resource type This is responding to PR clarifications from @justinvp and @lblackstone. * Update CHANGELOG_PENDING.md * Detect recursively defined objects * Display recursion warning * Check which recursive structures fail * Add internal logic tests for replaceOnChanges * Add tests
55 lines
1.1 KiB
JSON
55 lines
1.1 KiB
JSON
{
|
|
"version": "0.0.1",
|
|
"name": "example",
|
|
"resources": {
|
|
"example::Dog": {
|
|
"properties": {
|
|
"bone": {
|
|
"type": "string",
|
|
"replaceOnChanges": true
|
|
}
|
|
}
|
|
},
|
|
"example::Pets": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"replaceOnChanges": true
|
|
},
|
|
"other": {
|
|
"$ref": "#/resources/example::Dog"
|
|
},
|
|
"toy": {
|
|
"$ref": "#/types/example::toy"
|
|
},
|
|
"friends": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/types/example::toy"
|
|
}
|
|
},
|
|
"foes": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/types/example::toy"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"types": {
|
|
"example::toy": {
|
|
"description": "This is a cat toy",
|
|
"type": "object",
|
|
"properties": {
|
|
"color": {
|
|
"type": "string",
|
|
"replaceOnChanges": true
|
|
},
|
|
"wear": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|