Open bensinober opened 5 years ago
Right, the way it's implemented right now doesn't make much sense and might be fixed.
Hi! I'm currently using this perl module for a project, and I ran into this issue. We need to be able to differentiate between passing a parameter with value undef, and not passing that parameter at all. What needs to happen to get this fix worked on?
Hi @meylingtaing, at the moment I do have much time to work on this.
There is a work-in-progress https://github.com/polettix/Raisin/commit/48a9e866079e45b7816f476cfb0f3a66d89d37c6 stared by @polettix, maybe it can be adopted somehow.
I'll try to do my best to resolve the issue, but unfortunately cannot give you any estimates on this.
Thanks for this great and simple descriptive API!
I am thinking that the following code: https://github.com/khrt/Raisin/blob/7e460eea59bfdd4ffcb387f27241959059dec354/lib/Raisin/Request.pm#L25-L37
will filter out also defined null values in JSON body, which makes it difficult to define optional params that can be null, meaning a typical PUT or PATCH request to "unset" a value. Say, you have a DB column that needs to be NULLed. Of course, you still get the "undef"s from req->raisin_parameters, so it can easily be circumvented, but I am still unsure why "undef"s should be removed from declared_params and params?
Is line 34 actually neccessary, is my point.