Skip to content

Struct, Value well know type not supported #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lizelive opened this issue Feb 3, 2022 · 3 comments · Fixed by #551
Closed

Struct, Value well know type not supported #332

lizelive opened this issue Feb 3, 2022 · 3 comments · Fixed by #551
Labels
enhancement New feature or request medium Medium effort issue, can fit in a single PR

Comments

@lizelive
Copy link

lizelive commented Feb 3, 2022

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

@lizelive
Copy link
Author

lizelive commented Feb 3, 2022

@Gobot1234 Gobot1234 added enhancement New feature or request medium Medium effort issue, can fit in a single PR labels Feb 7, 2022
@Lucky3337
Copy link

Lucky3337 commented Mar 3, 2023

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)

@woodruffw
Copy link
Contributor

I believe #551 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium Medium effort issue, can fit in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants