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

Method Validate

internal/patch/patch.go:101–110  ·  view source on GitHub ↗

Validate validates the PATCH operation. Unknown attributes in complex values are ignored. The returned interface contains a (sanitised) version of given value based on the attribute it targets. Multi-valued attributes will always be returned wrapped in a slice, even if it is just one value that was

()

Source from the content-addressed store, hash-verified

99// contains a (sanitised) version of given value based on the attribute it targets. Multi-valued attributes will always
100// be returned wrapped in a slice, even if it is just one value that was defined within the operation.
101func (v OperationValidator) Validate() (interface{}, error) {
102 switch v.Op {
103 case OperationAdd, OperationReplace:
104 return v.validateUpdate()
105 case OperationRemove:
106 return v.validateRemove()
107 default:
108 return nil, fmt.Errorf("invalid operation Op: %s", v.Op)
109 }
110}
111
112// getRefAttribute returns the corresponding attribute based on the given attribute path.
113//

Callers 3

validateEmptyPathMethod · 0.95
validateUpdateMethod · 0.45
validateRemoveMethod · 0.45

Calls 2

validateUpdateMethod · 0.95
validateRemoveMethod · 0.95

Tested by

no test coverage detected