Skip to content

Commit

Permalink
fix parameter validation for biblioType
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Nov 20, 2020
1 parent 3a9bd88 commit 2de0b87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/api.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ declare function api:validate-placeOfAddressee($model as map(*)) as map(*)? {
: or by sending a comma separated list as the value of one URL parameter
~:)
declare function api:validate-biblioType($model as map(*)) as map(*)? {
if(every $i in $model?biblioType ! tokenize(., ',') satisfies wdt:biblio($i)('check')()) then map { 'biblioType': $model?biblioType ! tokenize(., ',') }
else error($api:INVALID_PARAMETER, 'Unsupported value for parameter "biblioType". It must be a WeGA biblio ID.' )
if(every $i in $model?biblioType ! tokenize(., ',') satisfies config:is-biblioType($i)) then map { 'biblioType': $model?biblioType ! tokenize(., ',') }
else error($api:INVALID_PARAMETER, 'Unsupported value for parameter "biblioType". It must be a valid WeGA biblioType, e.g. "book" or "artivle".' )
};

(:~
Expand Down

0 comments on commit 2de0b87

Please sign in to comment.