Bugzilla – Attachment 132131 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 summary of x-koha-embed header to api spec
Bug-29810-Add-summary-of-x-koha-embed-header-to-ap.patch (text/plain), 2.42 KB, created by
Martin Renvoize (ashimema)
on 2022-03-24 12:37:50 UTC
(
hide
)
Description:
Bug 29810: Add summary of x-koha-embed header to api spec
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-24 12:37:50 UTC
Size:
2.42 KB
patch
obsolete
>From c65346604912ab812bfd08b19ef94bbd3cc097e0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 6 Jan 2022 12:59:42 +0000 >Subject: [PATCH] Bug 29810: Add summary of x-koha-embed header to api spec > >--- > api/v1/swagger/swagger.yaml | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index e6ef3589f6..6f777a31cf 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -445,7 +445,10 @@ info: > level will result in an "AND" query, whilst combinding them in an `ARRAY` wilth result in an > "OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those > results with both field1 containing value2 AND field2 containing value2 for example. >- >+ >+ Additionally, if you are requesting related data be embedded into the response one can query >+ on the related data using dot notation in the field names. >+ > ### Examples > > The following request would return any patron with firstname "Henry" and lastname "Acevedo"; >@@ -456,12 +459,24 @@ info: > > `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"` > >- The following request would return any patron whilse lastname is "Acevedo" OR "Bernardo" >+ The following request would return any patron whose lastname is "Acevedo" OR "Bernardo" > > `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"` > >+ The following request embeds the related patron extended attributes data and filters on it. >+ >+ `curl -u koha:koha =--request GET 'http://127.0.0.1:8081/api/v1/patrons/' --header 'x-koha-embed: extended_attributes' --data-raw '{ "extended_attributes.code": "internet", "extended_attributes.attribute": "1" }'` >+ > ## Special headers >- >+ >+ ### x-koha-embed >+ >+ This optional header allows the api consumer to request additional related data >+ to be returned in the api response. It also allows for cross referencing in the >+ queries as described above. It accepts a comma delimited list of relation names. >+ >+ Relations may on occasion also support dot delimited nesting to allow traversal. >+ > ### x-koha-library > > This optional header should be passed to give your api request a library >-- >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