[Bug 32997] New: Add REST API endpoint to list authorised values for multiple given categories
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Bug ID: 32997 Summary: Add REST API endpoint to list authorised values for multiple given categories Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ERM Assignee: jonathan.druart+koha@gmail.com Reporter: pedro.amorim@ptfs-europe.com CC: jonathan.druart+koha@gmail.com, jonathan.field@ptfs-europe.com, martin.renvoize@ptfs-europe.com, pedro.amorim@ptfs-europe.com, tomascohen@gmail.com Bug 32981 adds the possibility of retrieving AV's given a category in the api. Currently, in ERM for example, 11 different AV categories are used, so 11 requests are necessary. Even if lazy-loaded, these are too many requests. Would be cool to have an AV api endpoint that accepts a list of AV codes and retrieves the values of the codes provided. Essentially doing what 32981 does but for multiple codes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32981 | Depends on| |32981 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32981 [Bug 32981] Add REST API endpoint to list authorised values for a given category -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, what we need is: GET /av_categories?q={"av_category_id":["av_1",...,"av_n"]} x-koha-embed: authorised_values:string The caveat about :string is that Jonathan is proposing on bug 32981 to return the full AV objects on the avs endpoint. But if the embed didn't include :string and only did the usual thing for embedding related objects, it would be good enough. Note: the idea behind :string is that it would 'calculate the right strings according to the context' (e.g. public? just the description for a dropdown?) but I don't have a clear idea for this particular use case so I'd move forward with what I proposed, without :string. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ERM |REST API Assignee|jonathan.druart+koha@gmail. |koha-bugs@lists.koha-commun |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=32997 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com -- 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=32997 Pedro Amorim <pedro.amorim@ptfs-europe.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=32997 --- Comment #2 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 146970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146970&action=edit Bug 32997: Add REST API endpoint to list authorised values for multiple given categories This patch adds /api/v1/authorised_value_categories endpoint that retrieves authorised value categories for the given names and their authorised values if x-koha-embed: authorised_values is also given. To test: Apply patch curl -u koha:koha --request GET \"http://localhost:8081/api/v1/authorised_value_categories?q=%5B%5B%7B%22me.category_name%22%3A%5B%22LOC%22%2C%22YES_NO%22%5D%7D%5D%5D\" --header \"x-koha-embed:authorised_values\" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart+koha@gmail. |pedro.amorim@ptfs-europe.co |com |m --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 11 parameters: 12 - name: category_names 13 in: query 14 description: Case insensitive search on category name 15 required: false 16 type: array 17 - name: x-koha-embed You have an extra 's' here, it should be category_name, or maybe even just 'name' (and add the mapping to Koha::AuthorisedValueCategory->to_api_mapping). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146970|0 |1 is obsolete| | --- Comment #4 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 147224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147224&action=edit Bug 32997: Add REST API endpoint to list authorised values for multiple given categories This patch adds /api/v1/authorised_value_categories endpoint that retrieves authorised value categories for the given names and their authorised values if x-koha-embed: authorised_values is also given. To test: Apply patch curl -u koha:koha --request GET \"http://localhost:8081/api/v1/authorised_value_categories?q=%7B%22me.category_name%22%3A%5B%22LOC%22%2C%22YES_NO%22%5D%7D\" --header \"x-koha-embed:authorised_values\" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #3)
11 parameters: 12 - name: category_names 13 in: query 14 description: Case insensitive search on category name 15 required: false 16 type: array 17 - name: x-koha-embed
You have an extra 's' here, it should be category_name, or maybe even just 'name' (and add the mapping to Koha::AuthorisedValueCategory->to_api_mapping).
Actually, I don't think that parameter is needed at all, since the category names are going into the query (q) param, correct? Tested it and provided a new patch with it removed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32983 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32983 [Bug 32983] Use REST API route to retrieve authorised values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 147237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147237&action=edit Bug 32997: Add REST API endpoint to list authorised values for multiple given categories Add tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147237|0 |1 is obsolete| | --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 147296 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147296&action=edit Bug 32997: Add tests Commit message fix -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Nick Clemens <nick@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=32997 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147224|0 |1 is obsolete| | Attachment #147296|0 |1 is obsolete| | --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 147340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147340&action=edit Bug 32997: Add REST API endpoint to list authorised values for multiple given categories This patch adds /api/v1/authorised_value_categories endpoint that retrieves authorised value categories for the given names and their authorised values if x-koha-embed: authorised_values is also given. To test: Apply patch curl -u koha:koha --request GET \"http://localhost:8081/api/v1/authorised_value_categories?q=%7B%22me.category_name%22%3A%5B%22LOC%22%2C%22YES_NO%22%5D%7D\" --header \"x-koha-embed:authorised_values\" Signed-off-by: Nick Clemens <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=32997 --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 147341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147341&action=edit Bug 32997: Add tests Signed-off-by: Nick Clemens <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=32997 Tomás Cohen Arazi <tomascohen@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=32997 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 147640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147640&action=edit Bug 32997: (QA follow-up) values => authorised_values This patch renames that for consistency, and also makes use of the ->authorised_values accessor on the category. 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=32997 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.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=32997 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 --- Comment #12 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to stable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Bug 32997 depends on bug 32981, which changed state. Bug 32981 Summary: Add REST API endpoint to list authorised values for a given category https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32981 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to stable |Needs documenting --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to 22.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33235 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33235 [Bug 33235] Cypress tests are failing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add REST API endpoint to |Add GET endpoint for |list authorised values for |listing authorised values |multiple given categories |by multiple given | |categories Severity|enhancement |new feature -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add GET endpoint for |Add GET endpoint for |listing authorised values |listing authorised value |by multiple given |categories |categories | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #14 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Back end stuff, doesn't affect the end user so there's nothing to add/amend in the manual. I'm told the API docs is automated, so there's no need to put those bugs as Needs documenting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32997 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17390 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17390 [Bug 17390] Add REST API endpoint for Authorised Values -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org