{"record":{"id":"c003e93b2dd4e75e","repo":"BerriAI/litellm","slug":"op-must-be-add-remove-or-replace","errorCode":null,"errorMessage":"op must be add, remove, or replace","messagePattern":"op must be add, remove, or replace","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/proxy/management_endpoints/scim_v2.py","lineNumber":174,"sourceCode":"    totalResults: int\n    startIndex: int | None = 1\n    itemsPerPage: int | None = 10\n    Resources: list[SCIMUser] | list[SCIMGroup]\n\n\n# SCIM PATCH Operation Models\nclass SCIMPatchOperation(BaseModel):\n    op: str\n    path: str | None = None\n    value: Any | None = None\n\n    @field_validator(\"op\", mode=\"before\")\n    @classmethod\n    def normalize_op(cls, v):\n        if isinstance(v, str):\n            v_lower: Final = v.lower()\n            if v_lower not in {\"add\", \"remove\", \"replace\"}:\n                raise ValueError(\"op must be add, remove, or replace\")\n            return v_lower\n        return v\n\n\nclass SCIMPatchOp(BaseModel):\n    schemas: list[str] = [\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"]\n    Operations: list[SCIMPatchOperation]\n\n\n# SCIM Service Provider Configuration Models\nclass SCIMFeature(BaseModel):\n    supported: bool\n    maxOperations: int | None = None\n    maxPayloadSize: int | None = None\n    maxResults: int | None = None\n\n\nclass SCIMServiceProviderConfig(BaseModel):","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/proxy/management_endpoints/scim_v2.py#L156-L192","documentation":"Pydantic before-validator on SCIMPatchOperation.op: the SCIM PATCH operation string (after lowercasing) is not one of add/remove/replace. SCIM v2 only defines those three ops, so anything else is rejected before normalization returns.","triggerScenarios":"Thrown at litellm/types/proxy/management_endpoints/scim_v2.py:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use op value 'add', 'remove', or 'replace' per SCIM patch semantics."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}