[Bug 24228] New: Add a parameter to recursively embed objects in Koha::Object(s)->to_api
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Bug ID: 24228 Summary: Add a parameter to recursively embed objects in Koha::Object(s)->to_api Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Using a syntax similar to MongoDB's dot notation, we need a way to specify which relations should be followed for recursively embedding objects. For example: $patron->to_api({ embed => { checkouts => { 'pickup_location' => 1 }, credits => 1 } }) -- 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=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23843 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23843 [Bug 23843] Make existing endpoints use Koha::Object(s)->to_api -- 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=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com, | |kyle@bywatersolutions.com, | |lari.taskula@hypernova.fi, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|tomascohen@gmail.com |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20936 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18731 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18731 [Bug 18731] Add routes for acquisition orders -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #1 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 96543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96543&action=edit Bug 24228: Add parameters to Koha::Object->to_api to automatically embed objects This patch adds the posibility to define 'x-koha-embed' parameter in swagger and in request headers. If 'x-koha-embed' header is present, in Koha::REST::V1::Auth it's compared with the whitelist defined in swagger through the 'x-koha-embed' parameter, placed at the same level of x-koha-authorization. Whitelist should be composed of DBIC relations (optinally chained by '.') that has the corresponding method in Koha::Object. To test: 1. Apply this patch 2. prove t/db_dependent/Koha/Object.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96543|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96612 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96612&action=edit Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that using dot notation (e.g. resource.related_resource.another_one) allows embedding objects recursively. To test: 1. Apply this patch 2. prove t/db_dependent/Koha/Object.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96613 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96613&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => [ { accessor => 'items', children => [ ... ] } ] } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96613|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96615 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96615&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => [ { accessor => 'items', children => [ ... ] } ] } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24302 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24302 [Bug 24302] Add a way to specify nested objects to embed in OpenAPI -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96615|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96622 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96622&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => { 'items' => { 'children' => { 'homebranch' => {} } } } } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Changed the embed structure to ease x-koha-embed -> to_api param translation. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|18731 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18731 [Bug 18731] Add routes for acquisition orders -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|20936 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96612|0 |1 is obsolete| | Attachment #96622|0 |1 is obsolete| | --- Comment #7 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 96644 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96644&action=edit Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that using dot notation (e.g. resource.related_resource.another_one) allows embedding objects recursively. To test: 1. Apply this patch 2. prove t/db_dependent/Koha/Object.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #8 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 96645 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96645&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => { 'items' => { 'children' => { 'homebranch' => {} } } } } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #9 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 96646 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96646&action=edit Bug 24228: (follow-up) Check wether each child or children can('to_api') and throw exception otherwise -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Agustín Moyano from comment #9)
Created attachment 96646 [details] [review] Bug 24228: (follow-up) Check wether each child or children can('to_api') and throw exception otherwise
Agustín, I'm not sure about your follow-up. I think it might be possible that we want to embed things that are not strictly Koha::Object-derived. I would prefer to leave it to the controller or the OpenAPI plugin to validate the result. Also, there should be tests for the changed behavior. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96646|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96645|0 |1 is obsolete| | --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96685&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => { 'items' => { 'children' => { 'homebranch' => {} } } } } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23893 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23893 [Bug 23893] Add ->new_from_api and ->set_from_api methods to Koha::Object -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Rebasing on top of 23893. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96644|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96685|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96686&action=edit Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that using dot notation (e.g. resource.related_resource.another_one) allows embedding objects recursively. To test: 1. Apply this patch 2. prove t/db_dependent/Koha/Object.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 96687 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96687&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => { 'items' => { 'children' => { 'homebranch' => {} } } } } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24366 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24366 [Bug 24366] Merging biblioitems should happen in Koha::Biblio->to_api -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Kyle M Hall <kyle@bywatersolutions.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=24228 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96686|0 |1 is obsolete| | Attachment #96687|0 |1 is obsolete| | --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 96954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96954&action=edit Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that using dot notation (e.g. resource.related_resource.another_one) allows embedding objects recursively. To test: 1. Apply this patch 2. prove t/db_dependent/Koha/Object.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 96955 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96955&action=edit Bug 24228: Make ->to_api params a hashref This patch makes the parameters for Koha::Object(s)->to_api a hashref preparing the ground for new parameters. The proposed syntax is: $object->to_api( { embed => { 'items' => { 'children' => { 'homebranch' => {} } } } } ); Tests are added for the Koha::Objects implementation and tests for Koha::Object are adjusted to the new syntax, and a test for the single result accessor is added as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- The uses here are clear and the code is mostly simple to follow.. Passing QA and pushing, no doubt there will be refinements down the line but there's nothing that stands out as introducing regressions or bad practice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch introduces a release notes| |parameter to the | |Koha::Object class | |('embed') that should be a | |hashref pointing to a data | |structure following what's | |documented in the code. | |This parameter allows the | |caller to specify things to | |embed recursively in the | |API representation of the | |object. For example: you | |could request a biblio | |object with its items | |attached, like this: | | | | | |$biblio_json = | |$biblio->to_api({ embed => | |{ items => {} } }); | | | |The | |main use of this is the | |API, as introduced by bug | |24302. | | | |Koha::Objects->to_api is | |adjusted to pass its | |parameters down to the | |Koha::Object. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This patch introduces a |This patch introduces a release notes|parameter to the |parameter to the |Koha::Object class |Koha::Object class |('embed') that should be a |('embed') that should be a |hashref pointing to a data |hashref pointing to a data |structure following what's |structure following what's |documented in the code. |documented in the code. |This parameter allows the |This parameter allows the |caller to specify things to |caller to specify things to |embed recursively in the |embed recursively in the |API representation of the |API representation of the |object. For example: you |object. For example: you |could request a biblio |could request a biblio |object with its items |object with its items |attached, like this: |attached, like this: | | | | |$biblio_json = |$biblio_json = |$biblio->to_api({ embed => |$biblio->to_api({ embed => |{ items => {} } }); |{ items => {} } }); | | |The |The |main use of this is the |names specified for |API, as introduced by bug |embedding, are used as |24302. |attribute names on the | |resulting JSON object, and |Koha::Objects->to_api is |are expected to be class |adjusted to pass its |accessors. |parameters down to the | |Koha::Object. |The main use of | |this is the API, as | |introduced by bug 24302. | | | |Koha::Objects->to_api is | |adjusted to pass its | |parameters down to the | |Koha::Object. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Architecture, internals, |REST API |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Version(s)|20.05.00 |20.05.00, 19.11.02 released in| | Status|Pushed to master |Pushed to stable --- Comment #19 from Joy Nelson <joy@bywatersolutions.com> --- Pushed to 19.11.x branch for 19.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- What does $curr mean? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #20)
What does $curr mean?
ok, it's current I guess. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24228 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org