idl_gen_json_schema.cpp: Fixed detection of enum types (#4438)

This commit is contained in:
schoetbi
2017-09-14 18:25:43 +02:00
committed by Wouter van Oortmerssen
parent cc25516d3e
commit 77b22aed5a

View File

@@ -69,7 +69,7 @@ std::string GenType(const std::string &name) {
}
std::string GenType(const Type &type) {
if (type.base_type == BASE_TYPE_CHAR && type.enum_def != nullptr) {
if (type.enum_def != nullptr && !type.enum_def->is_union) {
// it is a reference to an enum type
return GenTypeRef(type.enum_def);
}