Using protobufjs, I'm trying to define a message that would have a field holding a standard JSON object.
In my Typescript code, I use
import {Field, Type} from 'protobufjs/light';
@Type.d('MyType')
class MyType {
@Field.d(1, 'google.protobuf.Struct', 'required')
public element: Record<string, unknown>;
}
At runtime, I get a failure with the message
Error: no such Type or Enum 'google.protobuf.Struct' in Type
What am I doing wrong? Is it possible to have messages containing variable JSON object data?