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

HTTP ERROR 404 when generating client using HTTPS URL #1532

Closed
FredrikErikJohansson opened this issue Jan 7, 2025 · 10 comments · Fixed by #1543
Closed

HTTP ERROR 404 when generating client using HTTPS URL #1532

FredrikErikJohansson opened this issue Jan 7, 2025 · 10 comments · Fixed by #1543
Labels
bug 🔥 Something isn't working needs info ⏳ Further information is required prioritized 🚚 This issue has been prioritized and will be worked on soon

Comments

@FredrikErikJohansson
Copy link

Description

From v0.61.0 the CLI returns HTTP ERROR 404 when generating the client using a HTTPS URL to a swagger.json

v0.60.1 works as expected

Reproducible example or configuration

openapi-ts -i https://valid-url.com/swagger.json -o src/client -c legacy/fetch

OpenAPI specification (optional)

No response

System information (optional)

No response

@FredrikErikJohansson FredrikErikJohansson added the bug 🔥 Something isn't working label Jan 7, 2025
@mrlubos mrlubos added the prioritized 🚚 This issue has been prioritized and will be worked on soon label Jan 7, 2025
@mrlubos
Copy link
Member

mrlubos commented Jan 8, 2025

@FredrikErikJohansson are you able to provide more information or replication steps? I am unable to replicate with the same command in a package.json script

@mrlubos mrlubos added the needs info ⏳ Further information is required label Jan 8, 2025
@cpoftea
Copy link

cpoftea commented Jan 8, 2025

@mrlubos same issue here. As you can see I first tested connection manually with response 200, later with openapi-ts with response 400 for the same address (📎 Node log screenshot)

@cpoftea
Copy link

cpoftea commented Jan 8, 2025

v0.60.1 works as expected

I confirm

📎 Node log screenshot 1
📎 Node log screenshot 2

@mrlubos
Copy link
Member

mrlubos commented Jan 9, 2025

Can others here confirm this issue occurs with Node 18? @cpoftea any chance you can switch to Node 20 or 22 to check if the issue persists? It seems like a good starting point, everything else looks similar and you're not even using HTTPS

@cpoftea
Copy link

cpoftea commented Jan 9, 2025

@mrlubos It doesn't look like a Node version problem. But here it is - issue persist.

v20

v22

@mrlubos
Copy link
Member

mrlubos commented Jan 9, 2025

@cpoftea Does your URL work when you call it with HEAD method instead of GET? What kind of server is it?

@FredrikErikJohansson
Copy link
Author

@mrlubos I tried calling our swagger with HEAD instead of GET and it returns 404

@epfn
Copy link

epfn commented Jan 9, 2025

I have same error with 0.61.1 version, API: https://bloshinyj-rynok-api.spaceapp.ru/swagger/v1/swagger.json

Error requesting https://bloshinyj-rynok-api.spaceapp.ru/swagger/v1/swagger.json
HTTP ERROR 404
ResolverError: Error requesting https://bloshinyj-rynok-api.spaceapp.ru/swagger/v1/swagger.json
HTTP ERROR 404
at Object.sendRequest (C:\Users\epfnc\projects\ProTest\node_modules.pnpm@[email protected]\node_modules@hey-api\json-schema-ref-parser\dist\lib\resolvers\url.js:39:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async hf (C:\Users\epfnc\projects\ProTest\node_modules.pnpm@[email protected][email protected]\node_modules@hey-api\openapi-ts\dist\index.cjs:1328:7511)
at async n (C:\Users\epfnc\projects\ProTest\node_modules.pnpm@[email protected][email protected]\node_modules@hey-api\openapi-ts\dist\index.cjs:1328:10270)
at async Promise.all (index 0)
at async pA (C:\Users\epfnc\projects\ProTest\node_modules.pnpm@[email protected][email protected]\node_modules@hey-api\openapi-ts\dist\index.cjs:1328:11103)
at async start (C:\Users\epfnc\projects\ProTest\node_modules.pnpm@[email protected][email protected]\node_modules@hey-api\openapi-ts\bin\index.cjs:113:21)

node 22.10.0

@mrlubos
Copy link
Member

mrlubos commented Jan 9, 2025

@epfn thank you for providing the URL, should be way faster to fix

@mrlubos
Copy link
Member

mrlubos commented Jan 9, 2025

Hey all, this will be fixed in the next release and separately I will work on improving the watch mode #1542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working needs info ⏳ Further information is required prioritized 🚚 This issue has been prioritized and will be worked on soon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants