Skip to content

How to use Slick Syntax

Adrien Siffermann edited this page Aug 4, 2016 · 1 revision

By default tasks will use the default JSON patch syntax with is a bit verbose. XML and JSON patch tasks support an enhanced minimal syntax:

the general form is :

op path => valueOrPath

where :

  • op will be the character mapped for the operation
    • + add
    • - remove (in that case => valueOrPath should be ommitted)
    • = replace
    • & copy
    • > move
    • ? test
  • path is the path or from path for copy and move operation.
  • valueOrPath is the json encoded value or the target path for copy and move operation.

Example

The following patch :

+ /version/notes => "a bullshit"
= /version/semver => "$(GITVERSION_SemVer)"

Applied to

{
    "version" : {
        "semver" : ""
    },
    "name" : "un nom"
}

will output

{
    "version":{
        "semver":"0.1.0",
        "notes":"a bullshit"
    },
    "name":"un nom"
}