diff --git a/upbc/upbdev.c b/upbc/upbdev.c index f41d38f00f..c3a205a2c5 100644 --- a/upbc/upbdev.c +++ b/upbc/upbdev.c @@ -59,13 +59,14 @@ static upb_StringView upbc_JsonEncode(const upbc_CodeGeneratorRequest* request, upb_DefPool* s = upb_DefPool_New(); const upb_MessageDef* m = upbc_CodeGeneratorRequest_getmsgdef(s); + const int options = upb_JsonEncode_FormatEnumsAsIntegers; - out.size = upb_JsonEncode(request, m, s, 0, NULL, 0, status); + out.size = upb_JsonEncode(request, m, s, options, NULL, 0, status); if (!upb_Status_IsOk(status)) goto done; char* data = (char*)upb_Arena_Malloc(arena, out.size + 1); - (void)upb_JsonEncode(request, m, s, 0, data, out.size + 1, status); + (void)upb_JsonEncode(request, m, s, options, data, out.size + 1, status); if (!upb_Status_IsOk(status)) goto done; out.data = (const char*)data;