Skip to content

Replace should have resource id parameter #45

@NaqGuug

Description

@NaqGuug

replace() expects that the resource id is included in the resource parameter. However, if you use scim2-models' contexts, like resource.model_dump(scim_ctx=Context.RESOURCE_REPLACEMENT_RESPONSE), the id will be set to None because it's read only. This combination means that the replace will never work. It only works if you don't use contexts or add the id manually.

My suggestion would be to add an id parameter to replace. Yes, users could manually add the id to the resource before calling it but honestly why not add that logic to replace itself. That way it's much clearer and easier for users to include the id, which comes from / goes to the PUT request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions