@@ -24,10 +24,9 @@ module namespace body = "http://e-editiones.org/roaster/body";
2424
2525import module namespace errors = "http://e-editiones.org/roaster/errors";
2626
27- declare
28- variable $bla := "bla"; (: A variable to check if it works :)
27+ declare variable $bla := "bla"; (: A variable to check if it works :)
2928
30- (:~
29+ (:~
3130 : Try to retrieve and convert the request body if specified
3231 :)
3332
@@ -39,11 +38,11 @@ declare function body:parse ($request as map(*)) {
3938 case "form-data" return
4039 body:parse-form-data($request?schema)
4140 (:
42- Parse body contents to XQuery data structure for media types
43- that were identified as being in JSON format.
44- NOTE: The data needs to be serialized again before it can be stored.
45- NOTE: For application/json-patch+json request:get-data returns an xs:string.
46- :)
41+ Parse body contents to XQuery data structure for media types
42+ that were identified as being in JSON format.
43+ NOTE: The data needs to be serialized again before it can be stored.
44+ NOTE: For application/json-patch+json request:get-data returns an xs:string.
45+ :)
4746 case "json" return
4847 let $data := request:get-data()
4948 return typeswitch ($data)
@@ -53,10 +52,10 @@ declare function body:parse ($request as map(*)) {
5352 default return
5453 util:binary-to-string($data) => parse-json()
5554 (:
56- Workaround for eXist-DB specific behaviour,
57- this way we will get parse errors as early as possible
58- while still having access to the data afterwards.
59- :)
55+ Workaround for eXist-DB specific behaviour,
56+ this way we will get parse errors as early as possible
57+ while still having access to the data afterwards.
58+ :)
6059 case "xml" return
6160 let $data := request:get-data()
6261 return typeswitch ($data)
0 commit comments