python-betterproto
python-betterproto copied to clipboard
Struct, Value well know type not supported
https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/struct
These should map to dict[str, any] and any
https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto
Hello everybody. I have the same issues when i compile the dataclass. Can you give me some advice to fix it?) I would be very grateful if you are able to help me
my proto file:
syntax = "proto3";
import "google/protobuf/struct.proto";
message Base {
google.protobuf.Struct data = 1;
}
output file, after compile:
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: base.proto
# plugin: python-betterproto
from dataclasses import dataclass
import betterproto
from .google import protobuf # Wrong import <----------- Error here
@dataclass
class Base(betterproto.Message):
data: protobuf.Struct = betterproto.message_field(1)
I believe #551 should fix this.