Closed
Description
And again, those are the two only reliable mechanisms allowing for truly extending schemas in an unambiguous fashion (yes, I love unambiguous definitions). Recall:
$merge
relies on JSON Merge Patch, aka RFC 7396;$patch
relies on JSON Patch, aka RFC 6902.
Recall:
- implementations would be REQUIRED to implement
$merge
; - implementations MAY implement
$patch
.
Why, then, define $patch
? Simply because it allows for schema alterations which $merge
cannot do. However, $merge
answers the vast majority of cases.
Recall of the rules:
- those keywords take precedence over all other JSON Schema keywords;
- however,
$ref
still takes precedence.