-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute with null values in POST and PUT requests. #102
Comments
Hi @ellavas I am sceptical about setting null value to required modifiable attribute, because this means that you want to remove the attribute
Actually, this means that no value was added to this attribute |
Not only to required attribute.
With the current implementation of the library, it's not possible to know if the client provide the attribute with a null value or if he omits the attribute to use a default one. I think this is the assumption described in the RFC. Then, you may want to define your attribute as required to be sure that the client sets explicitly the attribute to null. |
Setting it to required means that the client should provide value to it in POST/PUT request. I think that setting null means that you don't want a value to be assigned to this attribute ... and this is a conflict with the mutability level. I agree that it looks confusing. If we can't come to an agreement It is possible to ask a question in the SCIM mailing list. |
Yes it could be interesting to have their feedback. My requirements: I have to provide a user extension to block the user at a given date. This date can be modified and can also be null. In this case, the user will be never be blocked. User is modified with a PUT, so the operation will replace all the attributes. This is my understanding of the RFC section
|
I think, that the problem is that you want to treat null as a real value and you would like the possibility to have different behaviour for null and non-existing values. IMHO, both should be the same and use other approach to achieve the desired feature. |
Hello,
When an attribute is "required", clients MUST specify the attribute in the POST and PUT request.
Moreover, the RFC7644 says "Clients that want to override a server's defaults MAY specify "null" for a single-valued attribute.
In the extension builder, the setAttribute method remove the attribute when the value is null. In that case, the required validator returns a bad request due to missing attribute.
When the attribute is not required, there is no difference between a missing parameter and a null value. So it's not possible to know if the value must be set to null or to a default value.
Do you have any advice on how to tackle this issue ?
Thanks
The text was updated successfully, but these errors were encountered: