fix(cpp-pistache-server): Add support for AnyType objects (#13232)

Co-authored-by: Ryan Shea <ryan.shea3@t-mobile.com>
This commit is contained in:
sheabot 2022-08-23 11:48:51 -06:00 committed by GitHub
parent b5fe7d02b0
commit 8c79f6d2c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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;|

View File

@ -139,12 +139,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
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