Open junhan87 opened 1 year ago
@jonaslagoni can you help to take a look on this?
Hey @junhan87, I am sorry, I could have sworn I had archived this 🤔
I am working (almost every day) on our own model generation tool under the AsyncAPI umbrella called Modelina. We just recently added C++ support, however, all of these different types are not supported, however easily achievable! I am more than happy to help over there, feel free to reach out on the AsyncAPI slack if you find this interesting.
Hi, I am using this template to geenerate C++ code. I am having issue that the generated data type is not the same as YAML file.
YAML file:
From above snippet, the format is set as uint32 and max is set to 4294967295 for unsigned type.
Then running this command:
Generated code:
std::shared_ptr data
data is generated as int64_t instead of uint32_t.
data_constraint(0, 4294967295, boost::none, boost::none, boost::none) Due to the maximum value is 4294967295 hence it is -1 if the type is int64_t. Hence any value pass to data, constraint check will throw exception.
Can you let me know where from the generator is generating int64_t instead of uint32_t from the format tag in YAML file?
Appreciate if you can shed some light to point me out how it is worked and where can I modify the tool.
Thanks.