-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Describe the bug
refers to an ungenerated message in the map
Dependencies
Input cmd:
python -m protobuf_to_pydantic --info # OR python -m protobuf_to_pydantic.plugin --info
Result:
# Paste the output of the command here
Protobuf File Content
Please check the Protobuf content for sensitive information
message DemoResp {
map<int32, DemoState> demoState = 1;
int64 pramsArea = 2;
bool paramsSeason = 3;
}
message DemoState {
int64 paramsDID = 4;
}Output content
class DemoResp(BaseModel):
"""
The issue refers to an ungenerated message in the map
"""
demoState: typing.Dict[int, DemoState] = Field(default_factory=dict)
pramsArea: int = Field(default=0)
paramsSeason: bool = Field(default=False)
class DemoState(BaseModel):
paramsDID: int = Field(default=0)Expected behavior
When referencing an ungenerated class, should use annotation:
class DemoResp(BaseModel):
"""
The issue refers to an ungenerated message in the map
"""
demoState: "typing.Dict[int, DemoState]" = Field(default_factory=dict)
pramsArea: int = Field(default=0)
paramsSeason: bool = Field(default=False)
class DemoState(BaseModel):
paramsDID: int = Field(default=0)Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels