Skip to content

Commit

Permalink
fix(cpp-pistache-server): Add support for AnyType objects (#13232)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Shea <ryan.shea3@t-mobile.com>
  • Loading branch information
sheabot and tmo-rshea3 authored Aug 23, 2022
1 parent b5fe7d0 commit 8c79f6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/generators/cpp-pistache-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
|Object|#include &quot;Object.h&quot;|
|nlohmann::json|#include &lt;nlohmann/json.hpp&gt;|
|std::map|#include &lt;map&gt;|
|std::string|#include &lt;string&gt;|
|std::vector|#include &lt;vector&gt;|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ public CppPistacheServerCodegen() {
typeMapping.put("UUID", "std::string");
typeMapping.put("URI", "std::string");
typeMapping.put("ByteArray", "std::string");
typeMapping.put("AnyType", "nlohmann::json");

super.importMapping = new HashMap<>();
importMapping.put("std::vector", "#include <vector>");
importMapping.put("std::map", "#include <map>");
importMapping.put("std::string", "#include <string>");
importMapping.put("Object", "#include \"Object.h\"");
importMapping.put("nlohmann::json", "#include <nlohmann/json.hpp>");
}

@Override
Expand Down

0 comments on commit 8c79f6d

Please sign in to comment.