[Bug 21334] New: Add bibliographic content type definitions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Bug ID: 21334 Summary: Add bibliographic content type definitions Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com Biblio and authority records need some content-type definitions to be added to the Mojolicious startup code: - 'application/marcxml+xml' - 'application/marc-in-json' - 'application/marc' -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 78563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78563&action=edit Bug 21334: Unit tests This patch adds unit tests for the new content types being added. It also adds tests for the 'json' overloading that already takes place in V1.pm. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 78564 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78564&action=edit 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, 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com, | |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17371 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17371 [Bug 17371] Add routes for biblios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21116 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78564|0 |1 is obsolete| | --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 78565 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78565&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Fixed minor mistake on usage explanation. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78565|0 |1 is obsolete| | --- Comment #5 from Michal Denar <black23@gmail.com> --- Created attachment 78585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78585&action=edit 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@gail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78563|0 |1 is obsolete| | Attachment #78585|0 |1 is obsolete| | --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 78599 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78599&action=edit Bug 21334: Unit tests This patch adds unit tests for the new content types being added. It also adds tests for the 'json' overloading that already takes place in V1.pm. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 78600 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78600&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, will not be backported to 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.04. After pushing bug 21116 I decided this one warranted backporting for the same reasons outlined on that bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |REOPENED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED --- Comment #11 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 17.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21334 Justin Jack <adamgrayling@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adamgrayling@gmail.com --- Comment #12 from Justin Jack <adamgrayling@gmail.com> --- (In reply to Josef Moravec from comment #7)
Created attachment 78600 [details] [review] 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 <https://whatstatus.co/guess-ill-die>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
After pushing bug 21116 I decided this one warranted backporting for the same reasons outlined on that bug. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org