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

swagger run localhost:3000/swagger/ can not find .json file #125

Open
zhouyujian opened this issue Jun 15, 2024 · 7 comments
Open

swagger run localhost:3000/swagger/ can not find .json file #125

zhouyujian opened this issue Jun 15, 2024 · 7 comments

Comments

@zhouyujian
Copy link

swagger can not find .json file , web import jsonfile url is http://localhost:3000/swagger/swagger/json ,double /swagger, so find 404 jsondata file.how to set swagger config to find this json

@mushonnip
Copy link

I just face the same problem, but suddenly realized that we cannot open swagger ui with slash ("/") on the end of url http://localhost:8000/swagger/

do http://localhost:8000/swagger instead

@MNFaizi
Copy link

MNFaizi commented Jul 19, 2024

i had same problem, in console showing error TypeError : app.getGlobalRoutes is not a function. (In 'app.getGlobalRoutes()', 'app.getGlobalRoutes' is undefined)

@ikemHood
Copy link

bun update fixed it for me

@MNFaizi
Copy link

MNFaizi commented Jul 25, 2024

bun update fixed it for me

thanks it work

@Mikey-ShenSu
Copy link

Mikey-ShenSu commented Oct 8, 2024

I'm running on Nextjs(14.2.14), and @elysiajs/swagger 1.1.3 does not work for me, so I downgraded to 1.1.1:

package.json:
"@elysiajs/swagger": "1.1.1"

@hmmhmmhm
Copy link

@Mikey-ShenSu Thank you. That worked for me too.

@gabriel-peracio
Copy link

Yep, can confirm.

In my case, I'm getting

GET https://json/ net::ERR_NAME_NOT_RESOLVED
Failed to fetch spec from URL: TypeError: Failed to fetch

The latest @elysiajs/swagger (1.1.6) only works if you:

new Elysia()
.use(
    swagger({
      documentation,
-      path: "/",
+      path: "/somethingelse",
    })
  )

In my case I wanted to host swagger on the root, not a separate path. Reverting to 1.1.1 fixes the issue.

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

No branches or pull requests

7 participants