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

Function Example_addWithoutPath

internal/patch/add_test.go:26–43  ·  view source on GitHub ↗

The following example shows how to add one or more attributes to a User resource without using a "path" attribute.

()

Source from the content-addressed store, hash-verified

24
25// The following example shows how to add one or more attributes to a User resource without using a "path" attribute.
26func Example_addWithoutPath() {
27 operation := `{
28 "op": "add",
29 "value": {
30 "emails": [
31 {
32 "value": "quint@elimity.com",
33 "type": "work"
34 }
35 ],
36 "nickname": "di-wu"
37 }
38}`
39 validator, _ := NewValidator(operation, schema.CoreUserSchema())
40 fmt.Println(validator.Validate())
41 // Output:
42 // map[emails:[map[type:work value:quint@elimity.com]] nickname:di-wu] <nil>
43}

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…