mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 13:07:02 +00:00
bugfix/set the default value for Swagger Array value.
This commit is contained in:
parent
ade36321ff
commit
e867fcd6bd
@ -22,6 +22,7 @@ object SwaggerDefinitionsJsonUtil {
|
||||
"iat": 1730373271,
|
||||
"nbf": 1730373271,
|
||||
"exp": 1730937600,
|
||||
"request_headers":[],
|
||||
"entitlements": [],
|
||||
"views": [ {
|
||||
"bank_id": "nlbkb",
|
||||
|
||||
@ -752,9 +752,10 @@ object SwaggerJSONFactory extends MdcLoggable {
|
||||
case _ if isTypeOf[JArray] =>
|
||||
exampleValue match {
|
||||
case JArray(v ::_) => s""" {"type": "array", "items":${buildSwaggerSchema(JsonUtils.getType(v), v)} }"""
|
||||
case _ =>
|
||||
logger.error(s"Empty JArray is not allowed in request body and response body example.")
|
||||
throw new RuntimeException("JArray type should not be empty.")
|
||||
case _ => s""" {"type": "array","items": {}}""" //if array is empty, we can not know the type here.
|
||||
// case _ =>
|
||||
// logger.error(s"Empty JArray is not allowed in request body and response body example.")
|
||||
// throw new RuntimeException("JArray type should not be empty.")
|
||||
}
|
||||
|
||||
case _ if isTypeOf[JObject] =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user