MCPcopy Create free account
hub / github.com/elimity-com/scim / Example_replaceSpecificSubAttribute

Function Example_replaceSpecificSubAttribute

internal/patch/replace_test.go:63–73  ·  view source on GitHub ↗

The following example shows how to change a specific sub-attribute "streetAddress" of complex attribute "emails" selected by a "valuePath" filter.

()

Source from the content-addressed store, hash-verified

61// The following example shows how to change a specific sub-attribute "streetAddress" of complex attribute "emails"
62// selected by a "valuePath" filter.
63func Example_replaceSpecificSubAttribute() {
64 operation := `{
65 "op": "replace",
66 "path": "addresses[type eq \"work\"].streetAddress",
67 "value": "ExampleStreet 100"
68}`
69 validator, _ := NewValidator(operation, schema.CoreUserSchema())
70 fmt.Println(validator.Validate())
71 // Output:
72 // ExampleStreet 100 <nil>
73}
74
75// The following example shows how to change a User's entire "work" address, using a "valuePath" filter.
76func Example_replaceWorkAddress() {

Callers

nothing calls this directly

Calls 3

ValidateMethod · 0.95
CoreUserSchemaFunction · 0.92
NewValidatorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…