https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853

            Bug ID: 27853
           Summary: POST /patrons doesn't enforce mandatory extended
                    attributes
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to