Hi @lhazlewood.
I miss the possibility to declare a Form Field Member as possible to omit when submitting a Form. This can be useful in for example a CRUD update scenario where semantics of setting a Member value to null would overwrite (3) persisted Member value with the null value while omitting the field when submitting the form would not affect the persisted Member value at all (2). (Or if complying with RFC 7396 - delete the persisted Field Member when Field Member in request is null)
In other words I want to be able to specify one Form where both 2 and 3 below are valid Form Submission Objects.
Scenario:
1:
PUT /person/1
{"name": "Peter", "age": 10} -> persisted Resource={"name": "Peter", "age": 10}
2:
PATCH /person/1
{"age": 11} -> persisted Resource={"name": "Peter", "age": 11}
3:
PATCH /person/1
{"name": null, "age": 12} -> persisted Resource={"name": null, "age": 12}
There are ways around this to accomplish almost the same thing. As I understand it I can for example use the 'mutable' Form Field Member and resend the Field Member value as it was persisted (with extra data on the wire as a consequence).
Please correct me if I have missed something but from my point of view this is something that should be possible to express in the form.
What are your thoughts on this?
Hi @lhazlewood.
I miss the possibility to declare a Form Field Member as possible to omit when submitting a Form. This can be useful in for example a CRUD update scenario where semantics of setting a Member value to null would overwrite (3) persisted Member value with the null value while omitting the field when submitting the form would not affect the persisted Member value at all (2). (Or if complying with RFC 7396 - delete the persisted Field Member when Field Member in request is null)
In other words I want to be able to specify one Form where both 2 and 3 below are valid Form Submission Objects.
Scenario:
1:
PUT /person/1
{"name": "Peter", "age": 10} -> persisted Resource={"name": "Peter", "age": 10}
2:
PATCH /person/1
{"age": 11} -> persisted Resource={"name": "Peter", "age": 11}
3:
PATCH /person/1
{"name": null, "age": 12} -> persisted Resource={"name": null, "age": 12}
There are ways around this to accomplish almost the same thing. As I understand it I can for example use the 'mutable' Form Field Member and resend the Field Member value as it was persisted (with extra data on the wire as a consequence).
Please correct me if I have missed something but from my point of view this is something that should be possible to express in the form.
What are your thoughts on this?