Koha/api/v1/swagger/definitions
Tomas Cohen Arazi 18ee07409a 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: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-09 10:31:47 +01:00
..
account_line.json Bug 26271: Add null to the list of accepted account_line data types 2020-09-03 14:18:23 +02:00
advancededitormacro.json
allows_renewal.json
basket.json
cashup.json Bug 26274: Add cashups api routes 2021-02-12 12:33:41 +01:00
checkout.json Bug 24083: Add support for unseen_renewals 2020-11-11 16:09:58 +01:00
checkouts.json
circ-rule-kind.json
city.json
club_hold.json
club_hold_patron_hold.json
club_hold_patron_holds.json
club_holds.json
error.json
extended_attribute.json Bug 27855: Add extended_attribute OpenAPI spec 2021-03-09 10:31:47 +01:00
fund.json
hold.json
holds.json
ill_backend.json
ill_backends.json
import_batch_profile.json Bug 23019: (follow-up) Fix usability issues 2020-11-11 15:55:49 +01:00
import_batch_profiles.json Bug 23019: (follow-up) Fix usability issues 2020-11-11 15:55:49 +01:00
invoice.json
item.json Bug 19889: Add new attribute to the REST API definition 2020-09-01 12:22:06 +02:00
library.json Bug 22818: (follow-up) Respond to feedback 2020-11-11 08:35:10 +01:00
order.json Bug 20212: Add more embeddable objects to orders 2021-01-28 16:44:11 +01:00
patron.json Bug 27855: Add 'extended_attributes' embedding to the spec 2021-03-09 10:31:47 +01:00
patron_account_credit.json
patron_balance.json
quote.json Bug 27251: Rewrite QOTD with the Koha REST API 2021-01-29 09:03:45 +01:00
return_claim.json
smtp_server.json Bug 22343: API routes for SMTP servers CRUD 2020-10-02 10:54:40 +02:00
vendor.json