Closed khardaw closed 4 years ago
i added a "flag" modifier for attributes. flags can also be optional.
e.g.
deleted: boolean optional flag
means that it will be included on GET, MULTIGET, PATCH & POST. if it's optional, well, it will be also marked as optional ;-P
I'd like to define a
deleted: boolean
parameter on a resource. This parameter can only be modified throughPATCH
but should also be retrieved throughGET
. The idea is that a PATCH to change this parameter and mark the resource as deleted should be intentional. This parameter should not be visible through POST however as there is no reason to create a new resource withdeleted = true
.The best way I could think to support this is to change the behavior of using both
mutable
andoutput
. When both are specified,mutable
should take precedence over the "output" parameter forPUT
andPATCH
endpoints. This meansmutable output
parameters will appear inPUT
,PATCH
,GET
, andMULTIGET
but not inPOST
.Or maybe this is a bad pattern and I should implement this a different way?