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

support templating language when constructing API calls #26

Closed
newgene opened this issue Aug 17, 2021 · 3 comments
Closed

support templating language when constructing API calls #26

newgene opened this issue Aug 17, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@newgene
Copy link
Member

newgene commented Aug 17, 2021

Translating from the SmartAPI's x-bte annotations (passed as bteEdges), call-apis constructs the actual API calls (like GET or POST queries) in builder_factory.

The current algorithm does not support multiple input values, only input[0] is accepted. And we should also support a set of predefined filter functions for common parameter transformation (e.g. concatenation, substr, trimming , add/remove CURIE prefixes etc).

We can use a common templating language to enhance the flexibility and capacity of the builder_factory, e. g. the commonly used mustache templating language can be a good option.

A nice mustache reference: http://cocoadocs.org/docsets/GRMustache.swift/0.9.3/

@newgene newgene added the enhancement New feature or request label Aug 17, 2021
@newgene
Copy link
Member Author

newgene commented Aug 17, 2021

relevant to this issue: biothings/biothings_explorer#147

@colleenXu
Copy link
Contributor

This is an issue I would like updates on. Since I would want to update the x-bte annotations if we have a more sophisticated way of specifying the query structure.

One goal from my perspective is:

  • some APIs expect their inputs to have prefixes. So I would like to be able to specify "append this prefix to each input ID, and then send the whole set of IDs to the API as a batch query" for APIs that can support batch-querying.

@colleenXu
Copy link
Contributor

Closing this issue for now, since it seems to be addressed by the PRs. Will reopen this issue or open new issues if this needs additional work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants