fix: supports setting a relative path for the API definition URL #649
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.
By setting a relative path, we can ensure that it works regardless of where the server is hosted.
For example, the server may be served from a subpath, which is unknown at compile time.
In the example from the module doc, we can set a relative path
./api/openapi
for the Swagger UI,which is equivalent to the absolute path
/api/openapi
when the server is hosted at the root path.But if the server is hosted at a subpath like
/myapp
, which is unknown at compile time,we can use a relative path instead.