OpenBankProject / OpenBankProject/OBP-API

getAdapter Resource Docs returns wrong example successful response

Open
#765 1 comment 0 reactions 1 assignee View on GitHub

@simonredfern is already working on this.

Since Nov 8, 2017.

Dominant language
Scala
Stars
1.7k
Forks
482
Avg merge
1d 12h
Merged PRs (30d)
15

Description

The resource doc returns usersJSONV200 but should return an example of Adapter

here's the current code:

resourceDocs += ResourceDoc(
getAdapter,
implementedInApiVersion,
"getAdapter",
"GET",
"/banks/BANK_ID/adapter",
"Get Info Of Adapter",
"""Get a basic Adapter info
|
|Login is required.
|
""".stripMargin,
emptyObjectJson,
usersJSONV200,
List(UserNotLoggedIn, UnknownError),
Catalogs(Core, notPSD2, notOBWG),
List(apiTagApi))

lazy val getAdapter: PartialFunction[Req, Box[User] => Box[JsonResponse]] = {
  case "banks" :: BankId(bankId) :: "adapter" :: Nil JsonGet _ => {
    user =>
      for {
        _ <- Bank(bankId) ?~! BankNotFound
        ai: InboundAdapterInfo <- Connector.connector.vend.getAdapterInfo() ?~ "Not implemented"
      }
      yield {
        successJsonResponseFromCaseClass(ai)
      }
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.