Koha-clms/Koha/REST
Tomas Cohen Arazi 2cec62128c
Bug 21334: Add bibliographic content type definitions
This patch adds the following content type definitions, to be used by
endpoint authors implementing MARC-related endpoints:

--------------------------------------
| Content-type             | Alias   |
|--------------------------|---------|
| application/marcxml+xml  | marcxml |
| application/marc-in-json | mij     |
| application/marc         | marc    |
--------------------------------------

Code using this aliases will use them like this:
- Suppose you want to output data in MARCXML format:

my $record = cool_method_that_returns_MARC_RECORD();
return $c->render( status => 200, format => 'marcxml', text => $record->as_xml_record );

Note: 'text' by defaults encodes output as UTF-8. If the encoding is not
UTF-8 you should encode the data on your own.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/V1.t
=> SUCCESS: Test pass!
- Sign off :-D

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

(cherry picked from commit b612ec7a0d)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2018-09-20 15:02:31 +01:00
..
Plugin Bug 21116: Add API routes through plugins 2018-09-20 12:09:27 +01:00
V1 Bug 20777: (follow-up) Remove 'dispute' reference in /credits endpoint 2018-09-17 15:26:55 +01:00
V1.pm Bug 21334: Add bibliographic content type definitions 2018-09-20 15:02:31 +01:00