quicktype
quicktype copied to clipboard
Change the C++ Min and Max Value type to int64_t
It makes more sense since the _integerType is also set to int64_t.
So in this generated code, we would now compare the int64_t value with *c.get_min_value() (also int64_t ):
inline void CheckConstraint(const std::string & name, const ClassMemberConstraints & c, int64_t value) {
if (c.get_min_value() != std::nullopt && value < *c.get_min_value()) {
throw ValueTooLowException ("Value too low for " + name + " (" + std::to_string(value) + "<" + std::to_string(*c.get_min_value()) + ")");
}
if (c.get_max_value() != std::nullopt && value > *c.get_max_value()) {
throw ValueTooHighException ("Value too high for " + name + " (" + std::to_string(value) + ">" + std::to_string(*c.get_max_value()) + ")");
}
}