Skip to content

$merge and $patch for "schema extensions" #15

Closed
@fge

Description

@fge

And again, those are the two only reliable mechanisms allowing for truly extending schemas in an unambiguous fashion (yes, I love unambiguous definitions). Recall:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions