-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[BUG] OAS3 server URL/host not parsed #3399
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
In OAS 2.0 host: api.example.com
basePath: /v1
schemes:
- https In OAS 3.0 servers:
- url: '{protocol}://api.example.com'
variables:
protocol:
enum:
- http
- https
default: https I think we should use the one parsed by the base utils. If an issue exist in the parsing of the server variables it is to be fixed in the base util classes
This is handled automatically by the Qt client when the scheme is https. Qt will use the host cert chain to verify the server. When a custom cert is to be used the Qt method is to be used below
|
After looking at the template, it seems that the scheme is handled: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache#L13 It looks like it is not parsed for OAS 3.0 |
Fixed with #4429 |
Bug Report Checklist
Hi,
After a long time working on other subject, I come back to openapi-generator because I seriously consider using it for my project.
Description
I'm encountering a issue when generating a Qt5 client where there is a URL generation error: the protocol is not added when building the request:
This code generate the following url:
api.myapp.com/v1/contact/{contactId}
instead ofhttps://api.myapp.com/v1/contact/{contactId}
.There is a easy way to fix it is to call
defaultApi.setHost("https://api.myapp.com")
beforefindContactById
but I guess it might broke in the long term.openapi-generator version
4.0.3
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
After generating the client, try to call the
OAIDefaultApi::findContactById()
method and see how the URL is badly formed.Related issues/PRs
None
Suggest a fix
I'll be happy to fix it but I'd like to have some direction how we should handle this case:
api.myapp.com
and nothttps://api.myapp.com
?https
protocol ?Ping @ravinikam @stkrwork @etherealjoy
The text was updated successfully, but these errors were encountered: