Skip to content

Nested messages don't have conformance to GRPCProtobufPayload generated #877

Closed
@davidpasztor

Description

@davidpasztor

Describe the bug

After updating to 1.0.0-alpha.15, updating protobuf to the latest version and regenerating the proto files, the generated code doesn't compile anymore, due to missing extension ProtoType: GRPCProtobufPayload {} conformances for all nested types.

Dependency versions:
grpc-swift 1.0.0-alpha.15
protobuf 3.12.3
swift-protobuf 1.10.0

Xcode 11.5

To reproduce

  1. Create a proto file with messages that contain nested messages.

All.pb

message ProtoMarketData {
    oneof marketData {
        List list = 1;
        Detail detail = 2;
    }

    message List {
        int32 id = 1;
    }

    message Detail {
        int32 id = 1;
    }
}
  1. Generate the swift files
  2. Try to build the swift files
  3. Compiler error

Type 'ProtoMarketData.Detail' does not conform to protocol 'GRPCPayload'

Expected behaviour

The generated code should compile

Additional information

Looking at the All.grpc.swift file, it contains a line extension ProtoMarketData: GRPCProtobufPayload {}, but no extensions for its nested messages, List and Detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugFeature doesn't work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions