-
Notifications
You must be signed in to change notification settings - Fork 2
Description
STAC PATCH will have two standards available when the pull request. JSON Merge PATCH (RFC7386) and JSON PATCH (RFC6902).
JSON merge use a partial Item to add or replace fields in an item. It treats null
values as removals, so is unable to set values to null
which is allowed in the STAC standard (not sure if this is required for ESGF). It could be used for most ESGF updates. Removing a primary asset while keeping the alternate assets wouldn't be possible without getting the current record.
JSON Patch uses a set of operations (Add, Replace, Remove, Move, Copy, Test). Any JSON merge request can be written as a set of Add/Replace and Remove operations. So JSON patch could be used for all ESGF updates. It could also allow removing primary assets through a combination of operations (move alternate assets to temporary location, remove primary, move new primary from alternates, more remaining alternates). But CV validation of Move/Copy operations isn't possible without getting the current record.
Both standards don't required the inclusion of the stac_extensions
field which we are planning to use for CV validation. We could enforce that these are always included or have a default set?
Options:
- Use only JSON Patch and don't validate Move/Copy operations.
- Use both standards for any applicable updates.
- Use both standards but restrict allowed updates e.g. JSON Patch only for asset updates.
- Restrict Move/Copy operations to specific updates.
- Write a new API extension for handling alternate asset updates.
- Something I haven't thought of