pb.hook cannot handle native types

Open
#161 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
lua
Domain
backend

Research direction

Start by reproducing the unknown type error when calling pb.hook() for the native bytes type. Compare that path with the recursive luatable proto traversal using pb.field(). Done means pb.hook() can handle bytes and encode it into base64 without requiring every field to be fixed manually.

Written by the indexing model from the issue text.

Description

enhancement

I am trying to hook bytes type to encode it into base64.

While I can hook other types, hooking native types gives me unknown type error.

I tried to recursively traverse the luatable proto representation and fix all the fields of type bytes ( by using pb.field() ), but this is tedious. Moreover, pb.hook() seems to be made exactly for this purpose.

Thanks

Dominant language
Lua
Stars
1.9k
Forks
400
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from starwing/lua-protobuf

All issues in starwing/lua-protobuf

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.