[Koha-bugs] [Bug 27855] Allow embedding extended_attributes on /patrons routes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 4 12:41:47 CET 2021


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #117684|0                           |1
        is obsolete|                            |

--- Comment #12 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 117688
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117688&action=edit
Bug 27855: Add 'extended_attributes' embedding to the spec

This patch just adds:
- The optional 'extended_attribute' attribute to the patron object
  OpenAPI definition. It consists of an array of extended_attribute
  objects.
- Add the x-koha-embed: [ 'extended_attributes' ] definition on the GET
  routes for patrons, allowing immedite availability of the
  'extended_attributes' embedding feature.

To test:
1. Apply this patchset
2. Restart Plack
3. Have some known patron_id/borrowernumber that has some extended
   attributes ('Patron attributes' on the UI).
4. Enable Basic authentication
5. Assuming the known patron_id is 1, point your favourite REST tool to
http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1
   e.g.: if your user/pass is koha/koha
   curl --location --request GET
'http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Basic a29oYTprb2hh'
=> SUCCESS: You get the patron object correctly, no extended_attributes
6. Repeat 5, adding the x-koha-embed header like this:
   curl --location --request GET
'http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/1' \
        --header 'Content-Type: application/json' \
        --header 'x-koha-embed: extended_attributes' \
        --header 'Authorization: Basic a29oYTprb2hh'
=> SUCCESS: You get the patron, with the extended attributes inside!
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list