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

Fix/add landing page links #229

Merged
merged 15 commits into from
Aug 18, 2021
Merged

Fix/add landing page links #229

merged 15 commits into from
Aug 18, 2021

Conversation

duckontheweb
Copy link
Contributor

@duckontheweb duckontheweb commented Aug 12, 2021

Related Issues:

Summary of Changes:

  • Uses a module-scoped fixture to fetch the landing page within test_conformance so that we only fetch it once
  • Adds parameterized tests for links related to the above issues
  • Adds root and service-desc links to landing page
  • Changes type of search link to "application/geo+json"

Questions:

I plan to add the equivalent changes to the sqlalchemy app but was having some trouble getting those tests to run and I thought I'd get feedback on this first. I got these working and added the equivalent tests.

cc: @philvarner

@duckontheweb duckontheweb marked this pull request as ready for review August 12, 2021 14:01
@lossyrob
Copy link
Member

Looks like this has some changes from #230 , we should merge that first and then update this branch.

@duckontheweb
Copy link
Contributor Author

Looks like this has some changes from #230 , we should merge that first and then update this branch.

I cherry picked the makefile change to make the sqlalchemy tests run, but other than that these should be able to be merged independently.

@philvarner
Copy link
Collaborator

Should we change the default OpenAPI endpoint to be /api to be in line with the recommendation in the STAC API spec?

In some way, I would wish that you didn't change it, so that a prominent implementation would be doing something other than /api, which would allow us to more easily find clients who hardcode /api rather than discovering the URL from the root links.

@geospatial-jeff
Copy link
Collaborator

geospatial-jeff commented Aug 16, 2021

It might be worth removing the openapi / docs endpoints from the landing page because I don't think they will work with changes introduced in #147

@duckontheweb
Copy link
Contributor Author

duckontheweb commented Aug 16, 2021

It might be worth removing the openapi / docs endpoints from the landing page because I don't think they will work with changes introduced in #147

They seem to be working okay on master right now. I'm serving up the pgstac dev app from the current master and the docs, redoc, and openapi.json endpoints are giving (what I think) are reasonable responses. Is there something in particular that might be broken about those?

cc: @geospatial-jeff

@philvarner
Copy link
Collaborator

I would recommend against removing them, even if they're not entirely accurate, as the link relation is required by stac api.

@duckontheweb
Copy link
Contributor Author

I would recommend against removing them, even if they're not entirely accurate, as the link relation is required by stac api.

@philvarner To me the STAC API docs are a little fuzzy on this point. There's this sentence from the Core API docs...

This spec does not require any API endpoints from OAFeat or STAC API to be implemented, so the following links may not exist if the endpoint has not been implemented.

...and then in the Link Relations section (emphasis added)...

The following Link relations should exist in the Landing Page (root).

However, in reality, it seems like root, self, and service-desc must be present and child may be present. Maybe we should reorganize those links a bit for clarity or change the wording?

That aside, I agree we should keep the links even if they're not perfect, as long as they are not misleading.

@duckontheweb
Copy link
Contributor Author

Should we change the default OpenAPI endpoint to be /api to be in line with the recommendation in the STAC API spec?

In some way, I would wish that you didn't change it, so that a prominent implementation would be doing something other than /api, which would allow us to more easily find clients who hardcode /api rather than discovering the URL from the root links.

I can see the usefulness of this from the client validation standpoint and I don't have a strong opinion on this, so I will go with whatever the consensus is. The thinking for changing it is that it seems like stac-fastapi is quickly becoming the de facto Python STAC API implementation, so it seems like it should follow best practices as closely as possibly.

@philvarner
Copy link
Collaborator

I would recommend against removing them, even if they're not entirely accurate, as the link relation is required by stac api.

@philvarner To me the STAC API docs are a little fuzzy on this point. There's this sentence from the Core API docs...

I agree that's not worded well. For one, that should be "shall" and not "should". (I shall fix it, if you should like)

Moving child out is a good idea.

@philvarner
Copy link
Collaborator

I can see the usefulness of this from the client validation standpoint and I don't have a strong opinion on this, so I will go with whatever the consensus is. The thinking for changing it is that it seems like stac-fastapi is quickly becoming the de facto Python STAC API implementation, so it seems like it should follow best practices as closely as possibly.

Definitely, stac-fastapi is that. Good point about following best practices

@duckontheweb
Copy link
Contributor Author

I would recommend against removing them, even if they're not entirely accurate, as the link relation is required by stac api.

@philvarner To me the STAC API docs are a little fuzzy on this point. There's this sentence from the Core API docs...

I agree that's not worded well. For one, that should be "shall" and not "should". (I shall fix it, if you should like)

Moving child out is a good idea.

😆 I should!

@duckontheweb
Copy link
Contributor Author

I can see the usefulness of this from the client validation standpoint and I don't have a strong opinion on this, so I will go with whatever the consensus is. The thinking for changing it is that it seems like stac-fastapi is quickly becoming the de facto Python STAC API implementation, so it seems like it should follow best practices as closely as possibly.

Definitely, stac-fastapi is that. Good point about following best practices

The OpenAPI endpoint is now configurable with ApiSettings.openapi_url and defaults to /api.

@duckontheweb
Copy link
Contributor Author

@geospatial-jeff @lossyrob This is ready for another look-over

@lossyrob lossyrob merged commit 8c78311 into stac-utils:master Aug 18, 2021
@duckontheweb duckontheweb deleted the fix/landing-page-links branch August 18, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants