jhonderson / actual-http-api

Basic Actual Budget API exposed through HTTP endpoints
MIT License
43 stars 13 forks source link

Create Account Documentation is Incorrect #17

Closed fanuch closed 3 months ago

fanuch commented 3 months ago

The swagger templated body is:

{
  "account": null,
  "name": "Checking",
  "offbudget": false
}

But the correct body is:

{
  "account": {
    "name": "Checking",
    "offbudget": false
  }
}

Kept on hitting 500 till I read the Actual API and noticed it expects type Account as the first param :)

https://actualbudget.org/docs/api/reference/#examples

createAccount(account, initialBalance = 0) → Promise<id>

Relevant part in source: https://github.com/jhonderson/actual-http-api/blob/main/src/v1/routes/accounts.js#L177-L234

I'm sorry, I don't code JS/Swagger much so it will take me a bit, but I will try and raise a PR against this issue

jhonderson commented 3 months ago

Hello, thanks for reporting. Please go ahead with the PR, happy to help if needed.

fanuch commented 3 months ago

The documentation is correct. I was using a Docker image that was cached (and 7 months old) which had the wrong API documentation.

In forking and attempting a fix I noticed I was wrong.

Apologies for the confusion!