Skip to content

Conversation

@mlebihan
Copy link
Contributor

@mlebihan mlebihan commented May 2, 2024

…fined "Object.h" (#2769)

Should handle Object.h, AnyType.h correctly. Set.h also tested.

  • #include Object.h removed and replaced by a typeMapping.put(object, nlohmann::json) like suggested in other issues
  • object had an invalid syntax: ':' instead of '::' in types with namespace
  • extra include of #include nlohmann/json.h removed when there's already #include <nlohmann/json.hpp>
  • nlohmann::json is excluded from model namespace

Tested with custom petstore played, with suggested openapi specs coming from issues #2769, #10266, #14234

rm -rf samples/server/petstore/cpp-pistache-everything/ && ./bin/generate-samples.sh ./bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml  && cd samples/server/petstore/cpp-pistache-everything/ && mkdir build && cd build && cmake .. && cmake --build . --parallel

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    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.
  • File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

…fined "Object.h" (OpenAPITools#2769)

Should handle Object.h, AnyType.h correctly. Set.h also tested.

   - #include Object.h removed and replaced by a typeMapping.put(object, nlohmann::json) like suggested in other issues
   - object had an invalid syntax: ':' instead of '::' in types with namespace
   - extra include of #include nlohmann/json.h removed when there's already #include <nlohmann/json.hpp>
   - nlohmann::json is excluded from model namespace

Tested with custom petstore played, with suggested openapi specs coming from issues OpenAPITools#2769, OpenAPITools#10266, OpenAPITools#14234

   ```bash
   rm -rf samples/server/petstore/cpp-pistache-everything/ && ./bin/generate-samples.sh ./bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml  && cd samples/server/petstore/cpp-pistache-everything/ && mkdir build && cd build && cmake .. && cmake --build . --parallel
   ```
@wing328
Copy link
Member

wing328 commented May 2, 2024

thanks for the PR.

suggestion (optional): what about adding a github work under ./github/worfklows to test samples/server/petstore/cpp-pistache-everything to ensure the output compiles? (or do it in another PR instead)

@wing328
Copy link
Member

wing328 commented May 2, 2024

please commit the new files in samples/server/petstore/cpp-pistache-everything/ when you've time

@mlebihan
Copy link
Contributor Author

mlebihan commented May 3, 2024

  • I've sent the content of samples/server/petstore/cpp-pistache-everything.

  • I didn't find a cpp-pistache workflow in the .github/workflows folder to take it for example to create a workflow for cpp-pistache-everything. If would be safer if I can start from it.

But they are others issues to correct in the C++ pistache generator, and I continue correcting them using samples/server/petstore/cpp-pistache-everything for that. I wish its yaml to carry the most different declarations it can.

As soon I will have enough knowledge to declare a workflow for it, I will, when submitting a next PR.

@wing328
Copy link
Member

wing328 commented May 3, 2024

@mlebihan
Copy link
Contributor Author

mlebihan commented May 3, 2024

./bin/utils/ensure-up-to-date returns "Git working tree is clean" locally now.

@wing328
Copy link
Member

wing328 commented May 4, 2024

thanks for the PR. let's give it a try

@wing328 wing328 merged commit fde8c77 into OpenAPITools:master May 4, 2024
@wing328 wing328 changed the title [BUG] [C++][Pistache] cpp-pistache-server generating API include unde… [BUG] [C++][Pistache] generating API include undefined "Object.h" May 4, 2024
@mlebihan mlebihan deleted the issue_2769_bug_cpp_pistache_server_undefined_Object_h branch May 5, 2024 02:05
@wing328 wing328 added this to the 7.6.0 milestone May 20, 2024
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.

2 participants