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

Include path fragment in open api spec and routes #792

Merged
merged 2 commits into from
Jun 25, 2021

Conversation

jisantuc
Copy link
Contributor

Overview

This PR makes it so that the API path fragment is respected everywhere. It accomplishes this through a helper method that takes an optional path prefix and the base path and builds a new endpoint input out of both.

Checklist

  • New tests have been added or existing tests have been modified

Testing Instructions

  • Start the server with /stac/api, stac/api, and stac/api/ --api-path arguments
  • http :9090/stac/api/collections with each of them
  • check :9090/open-api/spec.yaml for each of them
  • start the server again with options like --with-tiles and --with-transactions
  • check the spec again
  • confirm that your path prefix is respected in all of the links

Closes #779 (if applicable)

@@ -134,10 +142,8 @@ $$$$
).routes
landingPageRoutes = new LandingPageService[IO](apiConfig).routes
router = CORS(
Router(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Router can be used to map different services on different endpoints, but tapir is already doing that for us with the endpoint definitions / http4s interpreter, so we can unindent

).endpoints ++ landingPage.endpoints
docs = allEndpoints.toOpenAPI("Franklin", "0.0.1")
docs = OpenAPIDocsInterpreter.toOpenAPI(allEndpoints, "Franklin", "0.0.1")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of a deprecation that's been annoying but unimportant for a while

@jisantuc
Copy link
Contributor Author

Gonna go ahead and 🤠 this in since I'm out all of next week

@jisantuc jisantuc merged commit 8c4e3c1 into master Jun 25, 2021
@jisantuc jisantuc deleted the bugfix/js/include-path-fragment branch June 25, 2021 13:40
Copy link
Contributor

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clean and shiny PR 🚀
🤦 pressing the button I forgot to press.

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.

Open API spec should include path fragment specified as --api-path parameter
2 participants