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

Redirect api calls ending without forward slash and unversioned call to /api #134

Open
nuest opened this issue Nov 30, 2015 · 5 comments
Open
Milestone

Comments

@nuest
Copy link

nuest commented Nov 30, 2015

http://insitu.webservice-energy.org/52n-sos-webapp/api/v1 returns a 404, http://insitu.webservice-energy.org/52n-sos-webapp/api/v1/ returns the desired response.

IMHO ..api/v1 should be redirected to ..api/v1/.

Similarly, http://insitu.webservice-energy.org/52n-sos-webapp/api/ and http://insitu.webservice-energy.org/52n-sos-webapp/api (both return a 404 error) should be redirected to ../api/v1/.

@ridoo
Copy link
Member

ridoo commented May 15, 2017

unversioned URLs will be the default in 2.x versions. One development goal of the API is staying backwards compatible so a URL containing a version is unneccessary and will cause confusion

@ridoo
Copy link
Member

ridoo commented May 15, 2017

It would be cool to have a landing page as well. A configuration option would be cool to either redirect users or showing the landing page.

The landing page should answer the following questions

  • what is available under this path?
  • what does a simple workflow look like to get data? making it more dynamic by using Javascript is a plus!
  • where to create issues?
  • where can I find more information? (documentation, code repository, links to 52°North, Sensor Web, responsible persons, etc.)
  • ...

@antego
Copy link
Contributor

antego commented May 16, 2017

As I understand the next behavior is expected:

  • ..api/v1/ - redirects to the landing page
  • ..api/v1 - redirects to the landing page or to ..api/v1/
  • ..api/ - redirects to the landing page
  • ..api - redirects to the landing page

@ridoo am I right?

@ridoo
Copy link
Member

ridoo commented May 17, 2017

version 2.x won't have the v1 part anymore as it lead to confusion (API will stay backwards compatible). However we have the following cases:

  1. {host}/{context}: respond currently with 404
  2. {host}/{context}/: respond currently with 404
  3. {host}/{context}/api: respond currently with 404
  4. {host}/{context}/api/: will respond with detailed endpoint descriptions (no redirect)

The first two cases should be done by configuring a welcome file within web.xml like this:

     <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

The third part should redirect to that landing/welcome page.

@ridoo ridoo added this to the v2.0.0 milestone May 17, 2017
antego added a commit to antego/series-rest-api that referenced this issue May 17, 2017
antego added a commit to antego/series-rest-api that referenced this issue May 18, 2017
@ridoo
Copy link
Member

ridoo commented May 22, 2017

will also fix #110

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

No branches or pull requests

3 participants