If there are extended attributes types that are mandatory, the POST /patrons route should fail if the request doesn't meet this requirement. Unfortunately, we have no way (yet) to pass extended attributes on the POST. So to solve this bug, we need to add a way to pass extended attributes along with the patron object. I propose: POST /patrons { "first_name": "Tomasito", ... "extended_attributes": { "SHOW_BCODE": [ 1 ], "COURSES": [ "ALGO1", "DATABASES" ] } } I choose to force them to be arrays for simplicity (they can be repeatable), but we can check the data type on the controller (i.e. if ( ref($extended_attributes) eq 'ARRAY') { # loop case } else { # scalar case } ). I'm open for opinions.
How about an array of extended_attribute objects? "extended_attributes": [ { "type": "whatever", "code": "yup" }, { "type": "another", "code": "top" } ]
At least the "Unique identifier" attribute check should be added as well there if it will be possible to add mandatory attribute in the future. And probably the same goes for checking the "Repeatable" attribute property.
(In reply to Joonas Kylmälä from comment #2) > At least the "Unique identifier" attribute check should be added as well > there if it will be possible to add mandatory attribute in the future. And > probably the same goes for checking the "Repeatable" attribute property. Yes! That's handled on bug 27857, in which this will rely.