Closed rynowak closed 7 years ago
From @danroth27 on April 1, 2015 16:16
@kirthik Do we currently return a 400 level error response if someone tries a test operation?
From @kirthik on April 1, 2015 17:4
No. We don't. It does nothing today.
Curious.. Will the Test Operator be implemented at some point? If so, do you know when? I'm requiring functionality that the test operator provides and I'm considering my options here.
As a workaround I use:
// JSON.stringify([{ op: "test", path: "/key", value: "key_value"}])
// [FromBody] JsonPatchDocument<CustomRequestModel> jsonPatchDocument
var operation = jsonPatchDocument.Operations.SingleOrDefault(
a => a.OperationType == OperationType.Test &&
a.path.Equals("/key", System.StringComparison.CurrentCultureIgnoreCase));
// (string)operation.value
From @kirthik on March 20, 2015 9:37
Test operation in code today does not compare anything. Removing the TODO from code. Pasting code snippet for reference.
Copied from original issue: aspnet/Mvc#2218