Skip to content

Support for bulk operations - #149

Open
frohrlich wants to merge 1 commit into
python-scim:mainfrom
frohrlich:bulk-operations
Open

Support for bulk operations#149
frohrlich wants to merge 1 commit into
python-scim:mainfrom
frohrlich:bulk-operations

Conversation

@frohrlich

@frohrlich frohrlich commented Aug 24, 2026

Copy link
Copy Markdown

@frohrlich
frohrlich marked this pull request as draft August 24, 2026 12:52
raise InvalidValueException(
detail="data is required for POST, PUT, or PATCH request operations"
).as_pydantic_error()
elif scim_ctx and Context.is_response(scim_ctx): # pragma: no branch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pragma: no branch?

@model_validator(mode="after")
def validate_operation_requirements(self, info: ValidationInfo) -> Self:
"""Validate operation requirements according to RFC 7644."""
scim_ctx = info.context.get("scim") if info.context else None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please return early when scim_ctx is None to align the behavior to the rest of the library.

if self.location is None and not (
self.method == BulkOperation.Method.post
and self.status is not None
and self.status >= 400

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFC says:

  response  The HTTP response body for the specified request
     operation.  When indicating a response with an HTTP status
     other than a 200-series response, the response body MUST be
     included.  For normal completion, the server MAY elect to omit
     the response body.

So technically that would include the 1** and 3** error responses

@azmeuk

azmeuk commented Aug 27, 2026

Copy link
Copy Markdown
Member

Please unlist the bulk samples in tests/test_models.py test_parse_and_serialize_examples test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants