You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We rely on --ts_proto_opt=useJsonName=true option so that the generated typing for our types has the correct casing. However, using this option causes the generated code for google/protobuf/struct.proto to be incorrect like so:
wrap(value: any): Value{constresult=createBaseValue();if(value===null){result.null_value=NullValue.NULL_VALUE;}elseif(typeofvalue==="boolean"){result.bool_value=value;}elseif(typeofvalue==="number"){result.number_value=value;}elseif(typeofvalue==="string"){result.string_value=value;}elseif(globalThis.Array.isArray(value)){result.list_value=value;}elseif(typeofvalue==="object"){result.struct_value=value;}elseif(typeofvalue!=="undefined"){thrownewglobalThis.Error("Unsupported any value type: "+typeofvalue);}returnresult;},
But the actual fields are named nullValue, boolValue etc... as can be seen as follows:
Disabling --ts_proto_opt=useJsonName=true will result in all the field being named snake case for the generated google/protobuf/struct.proto code and the issues goes away but we are left with incorrect casing for our own definitions.
The text was updated successfully, but these errors were encountered:
Is not respecting the useJsonName flag--if you could submit a PR that fixes that, and ideally add a Struct usage to one of our integration/* tests that sets useJsonName=true, that would be great! Thank you!
We rely on
--ts_proto_opt=useJsonName=true
option so that the generated typing for our types has the correct casing. However, using this option causes the generated code forgoogle/protobuf/struct.proto
to be incorrect like so:But the actual fields are named
nullValue
,boolValue
etc... as can be seen as follows:Disabling
--ts_proto_opt=useJsonName=true
will result in all the field being named snake case for the generatedgoogle/protobuf/struct.proto
code and the issues goes away but we are left with incorrect casing for our own definitions.The text was updated successfully, but these errors were encountered: