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

[qt5 server] various improvements #725

Merged
merged 20 commits into from
Aug 24, 2018

Conversation

etherealjoy
Copy link
Contributor

@etherealjoy etherealjoy commented Aug 2, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

  • Fix template function to convert map to Json
  • Treat Qt5 natively handled data types as primitive
  • fix serialization of primitive response types
  • simplify mustache for models
  • README.MD improvements
  • support multi path parameters

@stkrwork @MartinDelille @ravinikam @fvarose

@wing328
Copy link
Member

wing328 commented Aug 3, 2018

cc @ravinikam @fvarose to review as well

@etherealjoy etherealjoy changed the title [qt5 server] improvements in array of primitive [qt5 server] various improvements Aug 10, 2018
@etherealjoy
Copy link
Contributor Author

For the future I would create some inline functions to clean up the code and make traversing the paths quicker.

@etherealjoy
Copy link
Contributor Author

etherealjoy commented Aug 12, 2018

@stkrwork @MartinDelille @ravinikam @fvarose @wing328
Any comments?
I would like to add a minor update in the future which will take this generator out of beta.
All in all it covers almost all server use cases .

@MartinDelille
Copy link
Contributor

@etherealjoy I did some comment about minor typo stuff.

}
List<CodegenParameter> params = new ArrayList<CodegenParameter>();
if (operation.bodyParam != null)params.add(operation.bodyParam);
if (operation.allParams != null)params.addAll(operation.allParams);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add allParams and also add query/body/header/query parameters, will params contain duplicated parameters?

I would also suggest adding a few comments to different code block in this function (postProcessOperations) so as to explain a bit more about the purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh ... does allParams include everything?
But actually depending on param type I need to check data type.
I will add comments. The goal here is that I consider Qt5 handled data types as native but I need to add the header, whereas default behavior is to not add headers for native types. There is no special handling needed for Qt5 handled types because the framework does everything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I have removed the duplicated parameters and added comments

@etherealjoy
Copy link
Contributor Author

Resolved merge conflicts.

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@etherealjoy etherealjoy merged commit f802f8b into OpenAPITools:master Aug 24, 2018
@etherealjoy etherealjoy added this to the 3.2.3 milestone Aug 24, 2018
@etherealjoy etherealjoy deleted the qt5server_improvements branch August 24, 2018 06:49
@wing328
Copy link
Member

wing328 commented Aug 30, 2018

@etherealjoy thanks again for the PR, which has been included in the v3.2.3 release: https://twitter.com/oas_generator/status/1035200785066254336

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Improve handling of all primitive types

* Fix missing includes in case of simple APIs

* Fix minor error in template function

* Remove tabs

* Refactor code for simplicity

* Remove tabs

* rework the router for handling multiple path param

* rework router to handle multiple path parameters

* rework router to handle multiple path parameters

* rework router

* Add support for Multi path param

* Add comments to code block and remove duplicate parameters

* Remove tabs :(

* Add missing imports after resolving conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants