Skip to content

Option to configure Web API parameters as path params #76

Description

@alexdma

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions