Skip to content

Commit 0cd5da9

Browse files
authored
Merge pull request #2525 from hongwei1/bugfix/swaggerIssue
Bugfix/swagger issue
2 parents ea83a66 + 925abbc commit 0cd5da9

File tree

9 files changed

+787
-744
lines changed

9 files changed

+787
-744
lines changed

obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala

Lines changed: 760 additions & 685 deletions
Large diffs are not rendered by default.

obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJsonUtil.scala

Lines changed: 0 additions & 39 deletions
This file was deleted.

obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerJSONFactory.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import com.openbankproject.commons.model.ListResult
3232
import code.util.Helper.MdcLoggable
3333
import net.liftweb.common.Box.tryo
3434
import net.liftweb.common.{EmptyBox, Full}
35+
import net.liftweb.http.provider.HTTPParam
3536
import net.liftweb.json
3637

3738
import scala.collection.GenTraversableLike
@@ -867,7 +868,7 @@ object SwaggerJSONFactory extends MdcLoggable {
867868
case Some(v) => getNestedRefEntities(v, excludeTypes)
868869
case Full(v) => getNestedRefEntities(v, excludeTypes)
869870
case coll: Coll[_] => coll.toList.flatMap(getNestedRefEntities(_, excludeTypes))
870-
case v if(! ReflectUtils.isObpObject(v)) => Nil
871+
case v if(! ReflectUtils.isObpObject(v) && !obj.isInstanceOf[HTTPParam]) => Nil
871872
case _ => {
872873
val entityType = ReflectUtils.getType(obj)
873874
val constructorParamList = ReflectUtils.getPrimaryConstructor(entityType).paramLists.headOption.getOrElse(Nil)

obp-api/src/main/scala/code/api/util/ExampleValue.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ object ExampleValue {
258258
lazy val issExample = ConnectorField("String","The Issuer Identifier for the Issuer of the response.")
259259
lazy val audExample = ConnectorField("String","Identifies the audience that this ID token is intended for. It must be one of the OBP-API client IDs of your application.")
260260
lazy val jtiExample = ConnectorField("String","(JWT ID) claim provides a unique identifier for the JWT.")
261-
lazy val iatExample = ConnectorField("String","The iat (issued at) claim identifies the time at which the JWT was issued. Represented in Unix time (integer seconds).")
262-
lazy val nbfExample = ConnectorField("String","The nbf (not before) claim identifies the time before which the JWT MUST NOT be accepted for processing. Represented in Unix time (integer seconds).")
263-
lazy val expExample = ConnectorField("String","The exp (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. Represented in Unix time (integer seconds).")
261+
lazy val iatExample = ConnectorField("60","The iat (issued at) claim identifies the time at which the JWT was issued. Represented in Unix time (integer seconds).")
262+
lazy val nbfExample = ConnectorField("60","The nbf (not before) claim identifies the time before which the JWT MUST NOT be accepted for processing. Represented in Unix time (integer seconds).")
263+
lazy val expExample = ConnectorField("60","The exp (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. Represented in Unix time (integer seconds).")
264264
lazy val emailVerifiedExample = ConnectorField("String","If the email is verified or not.")
265265

266266
lazy val emailExample = ConnectorField(s"${userNameExample.value}@example.com", "An email address.")
@@ -1010,7 +1010,13 @@ object ExampleValue {
10101010
lazy val toTransferToAtmExample = ConnectorField(NoExampleProvided,NoDescriptionProvided)
10111011
glossaryItems += makeGlossaryItem("to_transfer_to_atm", toTransferToAtmExample)
10121012

1013-
lazy val jwtExample = ConnectorField(NoExampleProvided,NoDescriptionProvided)
1013+
lazy val jwtExample = ConnectorField("eyJhbGciOiJIUzI1NiJ9.eyJlbnRpdGxlbWVudHMiOltdLCJjcmVhdGVkQnlVc2VySWQiOiJhYjY1Mz" +
1014+
"lhOS1iMTA1LTQ0ODktYTg4My0wYWQ4ZDZjNjE2NTciLCJzdWIiOiIyMWUxYzhjYy1mOTE4LTRlYWMtYjhlMy01ZTVlZWM2YjNiNGIiLCJhdWQiOiJ" +
1015+
"lanpuazUwNWQxMzJyeW9tbmhieDFxbXRvaHVyYnNiYjBraWphanNrIiwibmJmIjoxNTUzNTU0ODk5LCJpc3MiOiJodHRwczpcL1wvd3d3Lm9wZW5i" +
1016+
"YW5rcHJvamVjdC5jb20iLCJleHAiOjE1NTM1NTg0OTksImlhdCI6MTU1MzU1NDg5OSwianRpIjoiMDlmODhkNWYtZWNlNi00Mzk4LThlOTktNjYxMW" +
1017+
"ZhMWNkYmQ1Iiwidmlld3MiOlt7ImFjY291bnRfaWQiOiJtYXJrb19wcml2aXRlXzAxIiwiYmFua19pZCI6ImdoLjI5LnVrLngiLCJ2aWV3X2lkIjoi" +
1018+
"b3duZXIifSx7ImFjY291bnRfaWQiOiJtYXJrb19wcml2aXRlXzAyIiwiYmFua19pZCI6ImdoLjI5LnVrLngiLCJ2aWV3X2lkIjoib3duZXIifV19." +
1019+
"8cc7cBEf2NyQvJoukBCmDLT7LXYcuzTcSYLqSpbxLp4","JSON Web Token")
10141020
glossaryItems += makeGlossaryItem("jwt", jwtExample)
10151021

10161022
lazy val requestedCurrentValidEndDateExample = ConnectorField(NoExampleProvided,NoDescriptionProvided)

obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ trait APIMethods510 {
15321532
|
15331533
""".stripMargin,
15341534
EmptyBody,
1535-
consentsJsonV400,
1535+
consentsInfoJsonV510,
15361536
List(
15371537
$UserNotLoggedIn,
15381538
$BankNotFound,
@@ -1571,7 +1571,7 @@ trait APIMethods510 {
15711571
|
15721572
""".stripMargin,
15731573
EmptyBody,
1574-
consentsJsonV400,
1574+
consentsInfoJsonV510,
15751575
List(
15761576
$UserNotLoggedIn,
15771577
$BankNotFound,

obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ object JSONFactory510 extends CustomJsonFormats {
894894
def createConsentsJsonV510(consents: List[MappedConsent]): ConsentsJsonV510 = {
895895
ConsentsJsonV510(
896896
consents.map { c =>
897-
val jwtPayload: Box[ConsentJWT] = JwtUtil.getSignedPayloadAsJson(c.jsonWebToken).map(parse(_).extract[ConsentJWT])
897+
val jwtPayload = JwtUtil.getSignedPayloadAsJson(c.jsonWebToken).map(parse(_).extract[ConsentJWT]).toOption
898898
AllConsentJsonV510(
899899
consent_reference_id = c.consentReferenceId,
900900
consumer_id = c.consumerId,

obp-api/src/main/scala/code/bankconnectors/rabbitmq/RabbitMQConnector_vOct2024.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
23492349
amount=amountExample.value),
23502350
creditorAccount=PaymentAccount("string"),
23512351
creditorName="string")),
2352-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
2352+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
23532353
agent_number="string")),
23542354
value= AmountOfMoney(currency=currencyExample.value,
23552355
amount=amountExample.value),
@@ -2514,7 +2514,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
25142514
amount=amountExample.value),
25152515
creditorAccount=PaymentAccount("string"),
25162516
creditorName="string")),
2517-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
2517+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
25182518
agent_number="string")),
25192519
value= AmountOfMoney(currency=currencyExample.value,
25202520
amount=amountExample.value),
@@ -2865,7 +2865,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
28652865
amount=amountExample.value),
28662866
creditorAccount=PaymentAccount("string"),
28672867
creditorName="string")),
2868-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
2868+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
28692869
agent_number="string")),
28702870
value= AmountOfMoney(currency=currencyExample.value,
28712871
amount=amountExample.value),
@@ -2971,7 +2971,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
29712971
amount=amountExample.value),
29722972
creditorAccount=PaymentAccount("string"),
29732973
creditorName="string")),
2974-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
2974+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
29752975
agent_number="string")),
29762976
value= AmountOfMoney(currency=currencyExample.value,
29772977
amount=amountExample.value),
@@ -3143,7 +3143,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
31433143
amount=amountExample.value),
31443144
creditorAccount=PaymentAccount("string"),
31453145
creditorName="string")),
3146-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
3146+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
31473147
agent_number="string")),
31483148
value= AmountOfMoney(currency=currencyExample.value,
31493149
amount=amountExample.value),
@@ -3228,7 +3228,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
32283228
amount=amountExample.value),
32293229
creditorAccount=PaymentAccount("string"),
32303230
creditorName="string")),
3231-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
3231+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
32323232
agent_number="string")),
32333233
value= AmountOfMoney(currency=currencyExample.value,
32343234
amount=amountExample.value),
@@ -3899,7 +3899,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
38993899
amount=amountExample.value),
39003900
creditorAccount=PaymentAccount("string"),
39013901
creditorName="string")),
3902-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
3902+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
39033903
agent_number="string")),
39043904
value= AmountOfMoney(currency=currencyExample.value,
39053905
amount=amountExample.value),
@@ -4171,7 +4171,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
41714171
amount=amountExample.value),
41724172
creditorAccount=PaymentAccount("string"),
41734173
creditorName="string")),
4174-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
4174+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
41754175
agent_number="string")),
41764176
value= AmountOfMoney(currency=currencyExample.value,
41774177
amount=amountExample.value),
@@ -4272,7 +4272,7 @@ trait RabbitMQConnector_vOct2024 extends Connector with MdcLoggable {
42724272
amount=amountExample.value),
42734273
creditorAccount=PaymentAccount("string"),
42744274
creditorName="string")),
4275-
to_agent=Some( transactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
4275+
to_agent=Some( TransactionRequestAgentCashWithdrawal(bank_id=bank_idExample.value,
42764276
agent_number="string")),
42774277
value= AmountOfMoney(currency=currencyExample.value,
42784278
amount=amountExample.value),

obp-api/src/main/scala/code/transactionrequests/MappedTransactionRequestProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class MappedTransactionRequest extends LongKeyedMapper[MappedTransactionRequest]
394394
agentNumber
395395
val agentNumberValue = if (agentNumberList.isEmpty) "" else agentNumberList.head
396396
val bankIdValue = if (bankIdList.isEmpty) "" else bankIdList.head
397-
Some(transactionRequestAgentCashWithdrawal(
397+
Some(TransactionRequestAgentCashWithdrawal(
398398
bank_id = bankIdValue,
399399
agent_number = agentNumberValue
400400
))

obp-commons/src/main/scala/com/openbankproject/commons/model/CommonModel.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ object RegulatedEntityTraitCommons extends Converter[RegulatedEntityTrait, Regul
912912
case class TransactionRequestCounterpartyId (counterparty_id : String)
913913

914914
//For AGENT_CASH_WITHDRAWAL, it needs the agent_number to find the toAgent--> toBankAccount
915-
case class transactionRequestAgentCashWithdrawal (bank_id: String , agent_number : String)
915+
case class TransactionRequestAgentCashWithdrawal (bank_id: String , agent_number : String)
916916

917917
case class TransactionRequestSimple (
918918
otherBankRoutingScheme: String,
@@ -1026,7 +1026,7 @@ case class TransactionRequestBodyAllTypes (
10261026
@optional
10271027
to_sepa_credit_transfers: Option[SepaCreditTransfers]= None,//TODO not stable, from berlin Group
10281028
@optional
1029-
to_agent: Option[transactionRequestAgentCashWithdrawal]= None,
1029+
to_agent: Option[TransactionRequestAgentCashWithdrawal]= None,
10301030

10311031
value: AmountOfMoney,
10321032
description: String

0 commit comments

Comments
 (0)