Open recanman opened 3 weeks ago
@recanman seems like we have some builds failing :) https://github.com/elysiajs/elysia-swagger/actions/runs/9555166692/job/26390291285?pr=127
Must've been asleep when making this PR, #11 was vastly outdated and I was attempting to fix a previous issue I had with this package.
I've been using this patch for getting custom paths to work:
diff --git a/node_modules/@elysiajs/swagger/dist/index.js b/node_modules/@elysiajs/swagger/dist/index.js
index 3863b14..7519681 100644
--- a/node_modules/@elysiajs/swagger/dist/index.js
+++ b/node_modules/@elysiajs/swagger/dist/index.js
@@ -31,7 +31,7 @@ export const swagger = ({ provider = 'scalar', scalarVersion = 'latest', scalarC
version: '0.0.0',
...documentation.info
};
- const relativePath = path.startsWith('/') ? path.slice(1) : path;
+ const relativePath = path;
app.get(path, () => {
const combinedSwaggerOptions = {
url: `${relativePath}/json`,
When setting a custom path for documentation (e.g
/api/docs
), Scalar requests the OpenAPI specification using the wrong path (as it is relative).