Bugzilla – Attachment 132230 Details for
Bug 29810
Add embed options documentation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29810: Add 'x-koha-embed' to reserved words
Bug-29810-Add-x-koha-embed-to-reserved-words.patch (text/plain), 2.19 KB, created by
Martin Renvoize (ashimema)
on 2022-03-25 11:52:21 UTC
(
hide
)
Description:
Bug 29810: Add 'x-koha-embed' to reserved words
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-25 11:52:21 UTC
Size:
2.19 KB
patch
obsolete
>From 87a3ea47f8384f8cb5859d08752c296293860448 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 24 Mar 2022 14:19:35 +0000 >Subject: [PATCH] Bug 29810: Add 'x-koha-embed' to reserved words > >The maintainers of Mojolicious::Plugin::OpenAPI and friends fixed the >problem with using collectionFormat for Headers in the upstream library. > >However, this highlighted an outstanding issue in our code when I ran >the unit tests. We have not been stripping x-koha-embed at the query >level as it did not exist in the reserved_words list. This patch >resolves that and gets the acquisitions_orders test passing again. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/Plugin/Query.pm | 2 +- > t/db_dependent/api/v1/acquisitions_orders.t | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm >index 5603e60294..ce47b8a1e9 100644 >--- a/Koha/REST/Plugin/Query.pm >+++ b/Koha/REST/Plugin/Query.pm >@@ -310,7 +310,7 @@ reference: https://metacpan.org/changes/distribution/JSON-Validator#L14 > > sub _reserved_words { > >- my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q query x-koha-query); >+ my @reserved_words = qw( _match _order_by _order_by[] _page _per_page q query x-koha-query x-koha-embed); > return \@reserved_words; > } > >diff --git a/t/db_dependent/api/v1/acquisitions_orders.t b/t/db_dependent/api/v1/acquisitions_orders.t >index 3025c1856b..cee1aecb5e 100755 >--- a/t/db_dependent/api/v1/acquisitions_orders.t >+++ b/t/db_dependent/api/v1/acquisitions_orders.t >@@ -113,7 +113,7 @@ subtest 'list() tests' => sub { > my $query = { "biblio.isbn" => { "-like" => "\%SOMETHING\%" } }; > > $t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders?q=" . encode_json($query) => {'x-koha-embed' => 'biblio'} ) >- ->status_is( 200, "Embeddig biblio.isbn doesn't make it explode" ) >+ ->status_is( 200, "Embedding biblio and searching on biblio.isbn doesn't make it explode" ) > ->json_has( "/0/biblio", "biblio object correctly embedded" ) > ->json_is( "/0/biblio/isbn", 'SOMETHING', 'Filtering by a biblioitems column works!' ); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29810
:
129063
|
129064
|
129067
|
129068
|
129069
|
129070
|
129071
|
129072
|
129073
|
132131
|
132132
|
132133
|
132134
|
132135
|
132136
|
132137
|
132160
|
132161
|
132162
|
132163
|
132164
|
132165
|
132166
|
132167
|
132223
|
132224
|
132225
|
132226
|
132227
|
132228
|
132229
|
132230
|
132255
|
132256
|
132257
|
132258
|
132259
|
132260
|
132261
|
132262
|
132341
|
132342
|
132343
|
132344
|
132345
|
132346
|
132347
|
132348
|
133063
|
133064
|
133065
|
133066
|
133067
|
133068
|
133069
|
133070
|
133285