jhonderson / actual-http-api

Basic Actual Budget API exposed through HTTP endpoints
MIT License
40 stars 9 forks source link

[mild issue] Fix swagger examples for getting individual entities #2

Closed jhonderson closed 9 months ago

jhonderson commented 10 months ago

The Swagger examples for getting information for individual entities (I.e when getting the information for a particular category id) is incorrect. It is:

{
  "data": null,
  "id": "106963b3-ab82-4734-ad70-1d7dc2a52ff4",
  "name": "For Spending",
  "is_income": false,
  "group_id": "d4394761-0427-4ad4-bde7-9a83e118541a"
}

But it should be:

{
  "data": {
    "id": "106963b3-ab82-4734-ad70-1d7dc2a52ff4",
    "name": "For Spending",
    "is_income": false,
    "group_id": "d4394761-0427-4ad4-bde7-9a83e118541a"
  }
}

The schema is fine, just the examples are incorrect. Not critical issue, I’ll fix it later, just creating this so I don’t forget.

cinderblockgames commented 10 months ago

This also needs to be done for creating entities.

Current:

{
  "transaction": null,
  "account": "729cb492-4eab-468b-9522-75d455cded22",
  "category": "9fa2550c-c3ff-498b-8df6-e0fbe2a62e0e",
  "amount": -7374,
  "payee_name": "Remitly",
  "date": "2023-06-23",
  "cleared": false
}

Should be:

{
  "transaction": {
    "account": "729cb492-4eab-468b-9522-75d455cded22",
    "category": "9fa2550c-c3ff-498b-8df6-e0fbe2a62e0e",
    "amount": -7374,
    "payee_name": "Remitly",
    "date": "2023-06-23",
    "cleared": false
  }
}

(PS thank you for making this service!!)