Commit b3737e4f authored by Günter Hipler's avatar Günter Hipler
Browse files

small modifications to display error codes

parent 8259b3f6
Pipeline #23513 failed with stage
in 26 seconds
......@@ -56,9 +56,11 @@ object GetRecordValidation extends ParameterValidationFunction {
//todo: make it right - only for completion here
case OaiCheckedVerbWithParameter(verb, _, _, _, _, _, _, allParameter, _) =>
val setWithIllegalItems = checkParameterByName(allParameter, AllowedParameter.getRecord)
//val setWithMissingItems = checkMissingParameterByName(AllowedParameter.getRecord, allParameter)
BadArgumentsErrorRunner(BadArgumentsParameter(verb.get, setWithIllegalItems.map(key => (key, key)).toMap, allParameter ))
val allItems = checkParameterByName(allParameter, AllowedParameter.getRecord).map(key =>
(key, "argument is illegal")).toMap ++
checkMissingParameterByName(AllowedParameter.getRecord, allParameter).map(key =>
(key, "argument is missing")).toMap
BadArgumentsErrorRunner(BadArgumentsParameter(verb.get, allItems, allParameter ))
//todo: additional case cluases to catch other illegal combinations
}
......
......@@ -50,8 +50,8 @@ case class BadArgumentsResponse(config: Configuration
case elem: Elem if elem.label == "request" =>
elem ++ {
val iterable: immutable.Iterable[Elem] =
for ((par,_) <- parameter.badArguments) yield
<error code="badArgument">{s"Illegal argument $par in request"}</error>
for ((key,text) <- parameter.badArguments) yield
<error code="badArgument">{s"$key $text in request"}</error>
iterable.toSeq
}
......
......@@ -21,7 +21,7 @@ spec:
containers:
- name: oai-api-prod-container
image: cr.gitlab.switch.ch/memoriav/memobase-2020/services/externalapis/oai:develop
#image: guenterh/hellok8s:v4
#image: image: guenterh/oaimemobase:v0.5
ports:
- containerPort: 9000
name: http
......
......@@ -21,6 +21,11 @@ wenn der record nicht vorhanden ist
- welche error codes verwende ich?
- wie implementiere ich das?
Missing argument
https://services.dnb.de/oai/repository?verb=GetRecord&identifier=oai:dnb.de/authorities/118540238
2) ListRecords
<OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>2021-03-18T09:49:16Z</responseDate>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment