-
-
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
[cpp-pistache] Various fixes for Pistache #497
[cpp-pistache] Various fixes for Pistache #497
Conversation
Add Map support
PetStore samples can be tested after build together with this change #495 |
I just checked all the concerned issues (listed above) and I agree that they are all fixed (#407 - cpprestsdk - too) General remark : The fixes don't implement the std::shared_ptr usage so that all objects are copied "instead of passing their content". That means a lack of performances. Good job @etherealjoy 👍 |
@CyrilleBenard |
@@ -245,26 +245,29 @@ void {{classname}}::fromJson(web::json::value& val) | |||
{{#isString}} | |||
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")])); | |||
{{/isString}} | |||
{{#isByteArray}}{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")]));{{/isByteArray}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stringFromJson does not exist, according to your header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stkrwork
I checked it and it is there. Actually I generated and tested this code
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache#L52
Fixes for cpp-rest-sdk
are in this PR also actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested using the spec from #407 for cpp-rest-sdk
See also comment by @CyrilleBenard above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this, and this is the modelbase header from your pr:
https://github.com/etherealjoy/openapi-generator/blob/4098c7ae299bb8e0e0b31a6beb37fbcb08700a81/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache
i cant seem to find the function there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stkrwork
This change is in cpp-rest-sdk-client
I simply combined both the fixes in one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nvm, i didn't see the cpp-rest-sdk-client in the path, my bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time, please separate it into two pull requests, or change the title, because i was not expecting cpprestsdk code in the pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry for the confusion.
{{/isString}} | ||
{{^isString}} | ||
{{/isString}}{{#isByteArray}} | ||
{{setter}}(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{{baseName}}")])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. Also tested using spec from #407
Confirmed by @CyrilleBenard above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised with this suspicious use of the undefined ModelBase::stringFromJson because I generated a cpprestsdk client with a heavy YAML input file and the build + partial link (lib generation) succeeded. May be I missed something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etherealjoy Yes sure but so, what's the @stkrwork remark about ?
stringFromJson does not exist, according to your header
I'm a little lost :
- I checked your current PR and I found no compilation issue
- @stkrwork said : stringFromJson does not exist
😨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i didnt see that that file was already part of the cpp rest sdk. i thought he was purely working on pistache in the pr, so that is why i was confused, because i checked the pistache file for modelbase-header
@wing328 |
@etherealjoy 👌 PR merged into master. Have a nice weekend. |
Nice 👍 |
I'll give it a shot this weekend to setup CI for My understanding is that I will need to build https://github.com/oktal/pistache manually. |
…#497) * Fix compilation of petstore for Pistache Add Map support * Add support for ByteArray * Add Support for ByteArray in cpprest * Implement TODOs
PR checklist
./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\
.master
,3.1.x
,4.0.x
. Default:master
.Description of the PR
Fixes #482
Fixes #446
Fixes #414
Fixes #407
Fixes #258
@stkrwork @MartinDelille @ravinikam