-
Notifications
You must be signed in to change notification settings - Fork 507
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
feat(openapi): support configuration via openapi
#2299
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hanspagel
changed the title
feat: make OpenAPI and Scalar endpoint configurable
feat(openapi): make OpenAPI and Scalar endpoint configurable
Mar 22, 2024
pi0
reviewed
Mar 22, 2024
pi0
reviewed
Mar 22, 2024
cpreston321
reviewed
Mar 26, 2024
pi0
approved these changes
Apr 3, 2024
pi0
changed the title
feat(openapi): make OpenAPI and Scalar endpoint configurable
feat(openapi): support configuration via Apr 3, 2024
openapi
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP need to update the dependency to fix the build
π Linked issue
β
β Type of change
π Description
This PR makes the OpenAPI endpoint configurable (
title
,description
,version
). Itβs still possible to just passexperimental.openAPI: true
, but you can also pass an object. This should make it a non-breaking addition.With this PR you can also pass a configuration for Scalar (eg. to use other themes). Itβs optional, but enables users to use a ton of powerful features. More on this here: https://github.com/scalar/scalar?tab=readme-ov-file#configuration
This PR removes the Scalar proxy. Itβs really helpful to avoid CORS issues when using the API client, but you canβt use an external proxy to send request to localhost, so itβs not really helpful for local development.
Note: This PR also adds @scalar/api-reference as a dev dependency, just to import the configuration type for convenience. We could also remove it and just allow
AnyObject
(not so helpful, though), copy the type to the package (which might be outdated quickly) or we move our types to a separate package. It seems to break the build, we definitely need to change this. What route should we take? π€Iβd love to add some tests, too, but havenβt looked into that yet. Thatβs why I submitted it as a draft for now.
Any kind of feedback is really appreciated! Weβre eager to make the OpenAPI stuff really great for everyone.
π Checklist