kinow / protobuf-uml-diagram

Create UML diagrams from Protobuf compiled .proto files using Python
https://github.com/kinow/protobuf-uml-diagram
Apache License 2.0
72 stars 12 forks source link

Homonymous messages declarated in different other messages #10

Closed njspok closed 4 years ago

njspok commented 4 years ago

UML Diagram must separate different 'message' declaration inner other 'messages'. For example:

syntax = "proto3";

service Calc {
    rpc Calc (SomeRequest) returns (Response) {}
    rpc SingleCalc(SomeOtherRequest) returns (Response) {}
}

message SomeRequest {
    message Shipment {
        string key = 1;
        string type = 2;

    }
    repeated Shipment shipments = 1;
}

message SomeOtherRequest {
    message Shipment {
        string key = 1;
        string type = 2;
    }
    repeated Shipment shipments = 1;
}

message Response {
    string code = 1;
}

Shipment messages is different entity - SomeRequest:Shipment and SomeOtherRequest:Shipment and on diagram must two elements, but isnt.

v_ex_pb2

kinow commented 4 years ago

Hi @njspok totally agree.

Would this one look better? Got it after updating the code to use .full_name instead of just .name. Sounds like the simplest fix?

issue_10_pb2

Thanks Bruno

kinow commented 4 years ago

@njspok I'm cutting a release with the fix in #10. Feel free to test it later and report in case of issues :+1: Thanks!!