Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API auto complete end points #3150

Closed
JC5 opened this issue Feb 25, 2020 · 10 comments
Closed

API auto complete end points #3150

JC5 opened this issue Feb 25, 2020 · 10 comments
Assignees
Labels
feature Requests for new stuff. fixed Bugs that are fixed (in a coming release).

Comments

@JC5
Copy link
Member

JC5 commented Feb 25, 2020

See title. Limited scope, limited search, so quick response.

@emansih
Copy link
Contributor

emansih commented Feb 27, 2020

Allow API consumers to decide the limit? Such as /api/search?type=transaction&limit=10

@JC5
Copy link
Member Author

JC5 commented Jun 17, 2020

(notes to self)

  1. A new controller to handle requests. Most auto complete code is already in this file so copy/paste away.
  2. Needs routes in api.php
  3. Needs Swagger documentation

Also needs some time spent on consistent returns. Always return "title", "id".. something else? Formatted title? raw data?

@emansih
Copy link
Contributor

emansih commented Jun 17, 2020

How would auto complete work in this context? web sockets or plain HTTP GET?

@JC5
Copy link
Member Author

JC5 commented Jun 17, 2020

I'm thinking plain GET but I know very little about web sockets. Would that be a better idea?

@emansih
Copy link
Contributor

emansih commented Jun 17, 2020

i'm not sure about resource usage. For GET, a poorly configured client would be sending quite a bit of network data back to backend. Imagine searching for each char updates, "Fancy Restaurant @ White House" contains 30 characters, a badly configured client would send 30 requests to the backend for suggestions.

@JC5
Copy link
Member Author

JC5 commented Jun 17, 2020

Yeah that's true.

@JC5 JC5 removed the help wanted label Jul 21, 2020
@JC5 JC5 self-assigned this Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 21, 2020
JC5 added a commit that referenced this issue Jul 23, 2020
JC5 added a commit that referenced this issue Jul 23, 2020
@JC5 JC5 added the fixed Bugs that are fixed (in a coming release). label Jul 23, 2020
JC5 added a commit that referenced this issue Jul 23, 2020
JC5 added a commit to firefly-iii/api-docs-generator that referenced this issue Jul 24, 2020
@JC5
Copy link
Member Author

JC5 commented Jul 24, 2020

New autocomplete endpoints will be available in the new release. They will, consistently, return array in the following format that you can use in any auto-complete thing. All internal Firefly III autocomplete fields will now also use these endpoints.

[
    {
        "id": 5,
        "name": "Object",
    }
]

This applies to ALL endpoints, regardless of the object. Some endpoints have extra fields.

  • The endpoint for accounts exposes name_with_balance for asset accounts and liabilities, type for all accounts and currency_* for all accounts.
  • A separate endpoint for currencies exposes the currency name as Euro (EUR) instead of Euro.
  • Both piggy bank endpoints (see below) expose currency information in currency_* fields.
  • A separate piggy bank endpoint exposes name_with_balance next to name which includes balance info for the piggy bank (ie. New couch ($300 / $500)).
  • Two transaction endpoints. They both expose both description and name (for consistency).
  • The second one exposes both name and description as #12: description.
  • The transaction type endpoint will always return US English transaction types.

The API docs will be updated when the new release is out.

JC5 added a commit that referenced this issue Jul 24, 2020
@JC5
Copy link
Member Author

JC5 commented Aug 14, 2020

Will be fixed in the next release, closing now.

@JC5 JC5 closed this as completed Aug 14, 2020
@psychowood
Copy link
Contributor

For reference: #3748

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Requests for new stuff. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

3 participants