forked from bluesky/tiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for patching, merging, replacing metadata (bluesky#688)
* add support to patch, merge, replace metadata * patch_metadata uses a http patch request with application/json-patch+json content type * merge_metadata can be triggered with a http patch request and application/merge-patch+json * add jsonpatch and json-merge-patch to requirements * lint suggestions * fix compat with python<3.11 by removing `NotRequired` * lint * fix compat with python 3.8 by removing `Required` * IMP `dict.update`-like `update_metadata()` method *) client-side construction of a json patch using input similar to dict.update *) special value `tiled.client.metadata_update.DELETE_KEY` for deleting keys (similar to `None` in json merge patch, but regains `None` as a valid value) * review suggestions 1/2 * Use `Sentinel` for `DELETE_KEY` * factor out `validate_metadata` utility function * rearranged `validate_metadata` to make diff readable * use SQL-backed adapter * lint * hopeful fix for CI error in py<3.10 🤞 * will `typing_extensions.TypedDict` make CI overlords happy? * Apply suggestions from code review Co-authored-by: Dan Allan <daniel.b.allan@gmail.com> * Implement CR suggestions * FEAT: option to retrieve JSON patch object without applying it * fix typo * reword examples in `update_metadata` * Add CR suggestions from @danielballan * add return type of `build_metadata_patch` to docstring * Update uniqueness check to current best practice. * 📖 Add `application/json-patch+json` dropdown option to openAPI docs * implement sub-mimetype in patch payload * linter suggestions * some pydantic2 migration fixes * pin python<3.11.9 to avoid dask error * remove python pin added in c140311 * restrict to standard mimetype ids, improve error message * add metadata patching in CHANGELOG * fix typo * add pytests for json- and merge- patching of metadata and specs * refactor patch mimetypes * add support for specs patching * Remove unused import introduced by rebase. * Update API docs for new name. * Fix docstring formatting. --------- Co-authored-by: Dan Allan <daniel.b.allan@gmail.com> Co-authored-by: Dan Allan <dallan@bnl.gov> Co-authored-by: kari Barry <kezzsim@gmail.com>
- Loading branch information
1 parent
3c19b6d
commit 10677a4
Showing
11 changed files
with
622 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.