elixir-grpc / grpc-reflection

elixir graph reflection support
Apache License 2.0
9 stars 6 forks source link

[bugfix] Fix incorrect package name extraction for nested messages #21

Closed zhihuizhang17 closed 8 months ago

zhihuizhang17 commented 8 months ago

Summary

The package_from_name/1 method in Builder.Util currently extracts an incorrect package name when given a nested message name.

For example:

>  Util.package_from_name("testServiceV3.TestRequest.Payload")
"testServiceV3.TestRequest"

It's supposed to return: testServiceV3

This PR fixes the issue by keeping only the outermost module component as the package name for any nested message input.

fixes #20