{"record":{"id":"a7f91024d78b7507","repo":"passbolt/passbolt_api","slug":"the-operation-type-s-is-not-supported-or-invalid","errorCode":null,"errorMessage":"The operation type `%s` is not supported or invalid","messagePattern":"The operation type `(.+?)` is not supported or invalid","errorType":"exception","errorClass":"Passbolt\\Scim\\Exception\\ScimException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Utility/Object/Operation.php","lineNumber":163,"sourceCode":"    public function getType(): ?string\n    {\n        return $this->operationType;\n    }\n\n    /**\n     * @param string|null $operationType\n     * @return $this\n     */\n    protected function setType(?string $operationType)\n    {\n        if ($operationType === null) {\n            $this->operationType = null;\n\n            return $this;\n        }\n        $operationType = strtolower($operationType);\n        if (!self::isValidType($operationType)) {\n            throw new ScimException(sprintf('The operation type `%s` is not supported or invalid', $operationType));\n        }\n        $this->operationType = $operationType;\n\n        return $this;\n    }\n\n    /**\n     * Return the path\n     *\n     * @return string|null\n     */\n    public function getPath(): ?string\n    {\n        return $this->path;\n    }\n\n    /**\n     * Return the value","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/Object/Operation.php#L145-L181","documentation":"The 'op' value of a SCIM operation must be one of the supported types (add, remove, replace, case-insensitive). setType lowercases the input and checks it against Operation::isValidType; anything else throws this ScimException. It prevents unknown or misspelled operation verbs from entering the PATCH pipeline.","triggerScenarios":"Calling Operation::setFromScim() or the constructor with an op like 'delete', 'Add User', 'modify', or an empty/invalid string, typically from a PATCH request Operations[] entry with an unknown op.","commonSituations":"Custom SCIM client uses a non-RFC7644 verb; IdP sends a vendor-specific op; typo in hand-written PATCH payload; localized/case issues in op names.","solutions":["Use only RFC 7644 operations: add, remove, replace.","Check Operation::isValidType / the class constants for the exact accepted set.","Log the raw op value from the request to spot typos or vendor extensions.","If a new operation is genuinely needed, extend isValidType and the handling code in the plugin."],"exampleFix":"// before\n{\"op\": \"modify\", \"path\": \"displayName\", \"value\": \"Alice\"}\n// after\n{\"op\": \"replace\", \"path\": \"displayName\", \"value\": \"Alice\"}","handlingStrategy":"validation","validationCode":"const ALLOWED_OPS = ['add', 'remove', 'replace'];\nif (!in_array(strtolower($op['op'] ?? ''), ALLOWED_OPS, true)) {\n    throw new InvalidArgumentException(\"Invalid SCIM op: \" . ($op['op'] ?? 'null'));\n}","typeGuard":"function isValidOpType(string $op): bool {\n    return in_array(strtolower($op), ['add', 'remove', 'replace'], true);\n}","tryCatchPattern":"try {\n    $operation = Operation::setFromScim($data);\n} catch (ScimException $e) {\n    // skip or remap unsupported op; alert on unknown IdP verbs\n}","preventionTips":["Restrict generated ops to add/remove/replace.","Normalize op casing before sending (server lowercases anyway, but validate early).","Check Operation::isValidType when upgrading the plugin, in case the accepted set changes.","Reject vendor-specific ops at the client boundary."],"tags":["scim","patch","invalid-enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}