Koha/t/Koha
Tomas Cohen Arazi 2dde059059
Bug 24528: Add a syntax to x-koha-embed to specify counts
This patch adds a + syntax to specify on the x-koha-embed header that we
want the count of a relation in the response. For example:

GET /patrons/1
x-koha-embed: checkouts+count

Would return a JSON representation of a Koha::Patron, with a new
attribute added: checkouts_count, which will be the result of calling
$patron->checkouts->count.

This is all done automatically in to_api. This patch makes parsing the
x-koha-embed header build the right structure for passing to the to_api
method.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-31 13:50:45 +00:00
..
Authority
I18N/po/xx_XX/LC_MESSAGES
Plugins Bug 23050: (QA follow-up) Add Koha::Plugins::Tab class 2019-11-05 08:13:59 +00:00
REST/Plugin Bug 24528: Add a syntax to x-koha-embed to specify counts 2020-01-31 13:50:45 +00:00
SearchEngine Bug 23089: Unit tests 2019-11-03 07:33:56 +00:00
Util
Config.t
Exceptions.t Bug 23425: (QA follow-up) Keep it generic 2019-09-23 10:41:58 +01:00
I18N.t
ItemType.t
RDF.t
Script.t
Script_cron.t
Z3950responder.t Bug 13937: Fix issues found in QA 2019-10-08 14:39:50 +01:00