C++ Httplib server codegen#21724
Conversation
|
you can search for toLowerCase in the project and see how other generators call this function to address the build failure |
474d239 to
145b0b3
Compare
|
Hello @wing328 , |
|
still failed can you try building the project locally to confirm the fix? |
145b0b3 to
d220c6e
Compare
|
I am building with this command.It is passing build locally. |
|
please try |
3234b2f to
10f300d
Compare
|
please review the build errors when you've time: https://github.com/OpenAPITools/openapi-generator/actions/runs/17289476813/job/49073762692?pr=21724 |
With the above command , I am facing errors for maven plugin: [INFO] openapi-generator-project .......................... SUCCESS [ 2.191 s] |
works for me without errors can you merge the latest master into your branch? |
10f300d to
5fa32aa
Compare
|
Hello @wing328 , |
|
Looks like , The CI/CD errors (such as "Null key for a Map not allowed in JSON" and missing schema warnings) are not related to my changes. I have only modified files relevant to the cpp-httplib-server improvements. The errors originate from test specifications or example files within the OpenAPI Generator test suite, not from my OpenAPI spec or any files I changed. My modifications do not introduce these issues. This is my analysis of these checks failed. In my local, builds for codegen, tests, and sample code builds are successfull. |
|
I'm able to repeat the issue locally. I'll take another look to see what I can do to resolve it Is it correct to say that you've tested with the auto-generated output (C++ server-side code) and it works fine for you? |
Yes, I am able to create the Jar file with codegen java code and used the same jar file to generate code for cpp-httplib server. And also I am able to build successfully and create a library with cmake using the generated code. |
5fa32aa to
7b3234e
Compare
|
Hello @wing328 , |
|
Builds are passed in the workflow. What are the next steps? Please guide. |
|
When I checked, it is failing because of this error: |
|
i'll take another look later today |
|
please replace tabs with 4-space |
13719d7 to
914e27d
Compare
...napi-generator/src/main/java/org/openapitools/codegen/languages/CppHttplibServerCodegen.java
Show resolved
Hide resolved
|
i did a test and found the following in the console: should some of these use |
rajvesh
left a comment
There was a problem hiding this comment.
i did a test and found the following in the console:
[main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum Status (needed for safe initialization) [main] INFO o.o.c.l.CppHttplibServerCodegen - Set enum values for Status: [UNSPECIFIED, AVAILABLE, PENDING, SOLD] [main] INFO o.o.c.l.CppHttplibServerCodegen - Processing enum for variable Status: isEnum=true, _enum=[AVAILABLE, PENDING, SOLD], allowableValues={enumVars=[{name=AVAILABLE, isString=false, value=AVAILABLE}, {name=PENDING, isString=false, value=PENDING}, {name=SOLD, isString=false, value=SOLD}], values=[AVAILABLE, PENDING, SOLD]} [main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum Status (needed for safe initialization) [main] INFO o.o.c.l.CppHttplibServerCodegen - Set enum values for Status: [UNSPECIFIED, AVAILABLE, PENDING, SOLD] [main] INFO o.o.c.l.CppHttplibServerCodegen - Model classname: PetOrCategory -> PetOrCategory [main] INFO o.o.c.l.CppHttplibServerCodegen - Processing enum for variable Status: isEnum=true, _enum=[AVAILABLE, PENDING, SOLD], allowableValues={enumVars=[{name=AVAILABLE, isString=false, value=AVAILABLE}, {name=PENDING, isString=false, value=PENDING}, {name=SOLD, isString=false, value=SOLD}], values=[AVAILABLE, PENDING, SOLD]} [main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum Status (needed for safe initialization) [main] INFO o.o.c.l.CppHttplibServerCodegen - Set enum values for Status: [UNSPECIFIED, AVAILABLE, PENDING, SOLD] [main] INFO o.o.c.l.CppHttplibServerCodegen - Processing enum for variable Status: isEnum=true, _enum=[AVAILABLE, PENDING, SOLD], allowableValues={enumVars=[{name=AVAILABLE, isString=false, value=AVAILABLE}, {name=PENDING, isString=false, value=PENDING}, {name=SOLD, isString=false, value=SOLD}], values=[AVAILABLE, PENDING, SOLD]} [main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum Status (needed for safe initialization) [main] INFO o.o.c.l.CppHttplibServerCodegen - Set enum values for Status: [UNSPECIFIED, AVAILABLE, PENDING, SOLD] [main] INFO o.o.c.l.CppHttplibServerCodegen - Model classname: Tag -> Tag [main] INFO o.o.c.l.CppHttplibServerCodegen - Model classname: User -> User [main] INFO o.o.c.l.CppHttplibServerCodegen - Processing enum for variable UserStatus: isEnum=true, _enum=[_0, _1, _2], allowableValues={enumVars=[{name=_0, isString=false, value=_0}, {name=_1, isString=false, value=_1}, {name=_2, isString=false, value=_2}], values=[_0, _1, _2]} [main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum UserStatus (needed for safe initialization) [main] INFO o.o.c.l.CppHttplibServerCodegen - Set enum values for UserStatus: [UNSPECIFIED, _0, _1, _2] [main] INFO o.o.c.l.CppHttplibServerCodegen - Processing enum for variable UserStatus: isEnum=true, _enum=[_0, _1, _2], allowableValues={enumVars=[{name=_0, isString=false, value=_0}, {name=_1, isString=false, value=_1}, {name=_2, isString=false, value=_2}], values=[_0, _1, _2]} [main] INFO o.o.c.l.CppHttplibServerCodegen - Added UNSPECIFIED value to enum UserStatus (needed for safe initialization)should some of these use
debuginstead ofinfo?
Ok, I will change to Debug. Also the label is not client:C++. This code is for server:C++.
|
Fixed the label 👍 |
To be clear, it's entirely up to you. I just found the output too verbose. |
|
I request , Could you please remove this username as reviewer. vasireddyrajesh. This is my another username. Let the username be consistent. |
c692af3 to
588a545
Compare
Supports: All OpenAPI 3.x data types: primitives, arrays, enums, nullable/optional fields, nested objects All parameter types: path, query, header, cookie, and combinations Schema composition: allOf (inheritance), oneOf (discriminated unions), anyOf (flexible unions) Security schemes: API key and bearer token authentication Discriminator-based polymorphic deserialization and error handling Provides: Error handling for invalid JSON, type mismatches, missing/unknown discriminator, and parameter validation Build system integration (CMake) for easy compilation and linking with required dependencies Clear build and run instructions for local development and testing Enables comprehensive, real-world validation of generated C++ server code against OpenAPI specifications
588a545 to
38adb5d
Compare
|
i'll fix that after merging this PR |
|
overall it looks good 👍 thanks for contributing a new generator. |
Thank you for your support. |
|
update: merged #22980 with minor code format change. |
PR checklist
Commit all changed files.
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*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)