-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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][Qt][client] Fixed issue with unique items in OpenAPI schema #11954
[Cpp][Qt][client] Fixed issue with unique items in OpenAPI schema #11954
Conversation
Changed: Always add Qt5::Gui to build Added: find_package for OpenSSL (if not Apple)
This reverts commit db5c342.
This reverts commit c4f055f.
Added equal operator for schema objects Added qhash Operator in api template depending on unique items output.insert(val) -- QSet (unique items) or ouput.appen(val) -- QList (not unique items)
@canadaduane thanks for the PR. Please update the samples (step 3 in the PR checklist) cc @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @MartinDelille (2018/03) @muttleyxd (2019/08) |
I think you mis-tagged me. |
…cpp][qt] and this schema
Okay now i have added a schema for the petstore with unique items plus a config to run the generator on that. |
@canadaduane sorry |
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.
Little typo: unqiue => unique
Co-authored-by: Martin Delille <[email protected]>
Co-authored-by: Martin Delille <[email protected]>
Can you please add the file |
modules/openapi-generator/src/test/resources/2_0/petstore_plus_unique.json
Outdated
Show resolved
Hide resolved
moved open api specification rerun generate samples
Somehow Node 0 failed ☹ |
For circleci failure, please ignore that for the time being. |
@wing328 Is there anything left to do for me ? |
@Thaulino thanks for the PR. I've merged #12124 into master to use a different spec for C++ qt 5 petstore client. Can you please rebase/merge latest master into your branch and add those tests in modules/openapi-generator/src/test/resources/3_0/petstore_plus_unique.json to modules/openapi-generator/src/test/resources/3_0/cpp-qt/petstore.yaml instead? |
For CircleCI node 0 failure, please ignore it as it's not related to this change. |
I tested it in the CI but got the following errors:
Can you please take a look when you've time? Ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/250142967 |
@wing328 : Thanks for testing and reviewing Hi, My interpretation of the error: Somehow the compiler doesn't find an overloaded version of qhash with the signature Disclaimer: I am not that deep into travis ci, containerization and so on Educated guess: Next steps: it does not fail: my educated guess is wrong |
Hi, I have created some minimal test setup based on docker
Looks similiar to the issue in travis ci, so it seems like the needed qhash function isn't implemented
My suggestion is to update the ubuntu version used in travis ci |
Tested locally with a Linux box instead and the result is good:
We will test locally instead of using Travis for the time being. Thanks for the PR. |
Details of change
object.mustache
Added equal operator
Added qhash Operator
This way, the schema can be stored in a QSet
in api template
depending on unique items
output.insert(val) -- QSet (unique items)
or
ouput.append(val) -- QList (not unique items)
Test done
I used the same openapi as attached to this issue [BUG] [Qt5][Cpp] Unique items in schema lead to error #11951
java -jar openapi-generator-cli-5.4.0.jar generate -t cpp-qt-templates -i unique_petstore.json -g cpp-qt-client -o unique_petstore
Build the library with cmake
related issues
resolves #11621
resolves #11951
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x
technical committee
@muttleyxd
@etherealjoy
@wing328