Skip to content

Commit

Permalink
fix function to cope with multiple values
Browse files Browse the repository at this point in the history
according to its documentation
  • Loading branch information
peterstadler committed Oct 29, 2024
1 parent 0ffa919 commit 9dfc5be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/api.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ declare function api:validate-sender($model as map(*)) as map(*)? {
: or by sending a comma separated list as the value of one URL parameter
~:)
declare function api:validate-textType($model as map(*)) as map(*)? {
if($model?textType castable as xs:string) then map { 'textType': xmldb:decode-uri($model?textType) }
if(every $i in $model?textType ! tokenize(., ',') satisfies $i castable as xs:string) then map { 'textType': $model?textType ! tokenize(., ',') ! xmldb:decode-uri(.) }
else error($api:INVALID_PARAMETER, 'Unsupported value for parameter "textType".' )
};

Expand Down

0 comments on commit 9dfc5be

Please sign in to comment.