Skip to content

Commit

Permalink
psd2 catalogue should cause spelling=ISO20022 header to be sent OpenB…
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Jan 22, 2019
1 parent 2e5e8e3 commit eb0ff22
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/scala/code/snippet/ApiExplorer.scala
Expand Up @@ -725,8 +725,21 @@ WIP to add comments on resource docs. This code copied from Sofit.
// TODO It would be nice to modify getResponse and underlying functions to return more information about the request including full path
// For now we duplicate the construction of the fullPath
val apiUrl = OAuthClient.currentApiBaseUrl

val urlWithVersion = s"$requestUrl"

val urlWithVersion =
if (showPSD2 == Some(true)) {
s"$requestUrl".split("\\?").toList match {
case url :: params :: Nil =>
url + params + "&format=ISO20022"
case url :: Nil =>
url + "?format=ISO20022"
case _ =>
s"$requestUrl"
}
} else {
s"$requestUrl"
}
logger.info(s"urlWithVersion is: " + urlWithVersion)

//val urlWithVersion = s"/$apiVersion$requestUrl"
val fullPath = new URL(apiUrl + urlWithVersion)
Expand Down

0 comments on commit eb0ff22

Please sign in to comment.