Docs.rs
  • json-patch-ext-0.1.1
    • json-patch-ext 0.1.1
    • Docs.rs crate page
    • MIT
    • Links
    • crates.io
    • Source
    • Owners
    • drmorr0
    • Dependencies
      • json-patch ^3 normal
      • jsonptr ^0.6.3 normal
      • serde_json ^1 normal
      • thiserror ^1 normal
      • assertables ^9.3.0 dev
      • rstest ^0.23.0 dev
    • Versions
    • 5% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate json_patch_ext

json_patch_ext0.1.1

  • All Items

Crate Items

  • Re-exports
  • Modules
  • Macros
  • Structs
  • Enums
  • Functions

Crates

  • json_patch_ext

Crate json_patch_ext

Source
Expand description

This module provides some unofficial “extensions” to the jsonpatch format for describing changes to a JSON document. In particular, it adds the * operator as a valid token for arrays in a JSON document. It means: apply this change to all elements of this array. For example, consider the following document:

{
  "foo": {
    "bar": [
      {"baz": 1},
      {"baz": 2},
      {"baz": 3},
    ]
  }
}

The pathspec /foo/bar/*/baz would reference the baz field of all three array entries in the bar array. It is an error to use * to reference a field that is not an array. It is an error to use * at the end of a path, e.g., /foo/*.

Additionally, this crate will auto-create parent paths for the AddOperation only, e.g., the result of applying AddOperation{ path: "/foo/bar", value: 1 } to the empty document will be

{ "foo": {"bar": 1}}

Re-exports§

pub use json_patch::AddOperation;
pub use json_patch::CopyOperation;
pub use json_patch::MoveOperation;
pub use json_patch::Patch;
pub use json_patch::PatchOperation;
pub use json_patch::RemoveOperation;
pub use json_patch::ReplaceOperation;
pub use json_patch::TestOperation;

Modules§

prelude

Macros§

format_ptr

Structs§

Pointer
A JSON Pointer is a string containing a sequence of zero or more reference Tokens, each prefixed by a '/' character.
PointerBuf
An owned, mutable Pointer (akin to String).

Enums§

PatchError

Functions§

add_operation
copy_operation
escape
move_operation
patch_ext
remove_operation
replace_operation
test_operation

Results

Settings
Help

Query parser error: "Unexpected - (did you mean ->?)".