Skip to content
New issue

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

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

Already on GitHub? # to your account

Option to configure Web API parameters as path params #76

Open
alexdma opened this issue Nov 5, 2018 · 0 comments
Open

Option to configure Web API parameters as path params #76

alexdma opened this issue Nov 5, 2018 · 0 comments

Comments

@alexdma
Copy link

alexdma commented Nov 5, 2018

It would be nice to be able to choose whether a parameter that maps to a SPARQL variable should be a query param or a path param. For example, one may want to turn:

basil/abcdef1234/api?type={type}&term={term}

into something like

basil/abcdef1234/api/{type}/{term}

This obviously means that the Web API parameters would become positional and there should be a way to configure that. I can think of a few ways:

  1. Extend the naming convention with ordering, for example ?_1_type could mean that type is a path parameter that comes before any other.
  2. Extend alias definition to support templating, for example if I want to alias abcdef1234 as search I could define the alias as {type}/search/{term}.
  3. Infer the order from where the variables first appear in the query (my least-favourite option).
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants