Support nested map messages in valdi_protobuf/web/test/NamespaceGenerator.spec.ts

Open
#217 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start with the skipped xit spec in src/valdi_modules/src/valdi/valdi_protobuf/web/test/NamespaceGenerator.spec.ts, then read the web namespace generator in the sibling web/ directory to see how scalar fields are built. Add map field support, including message values, and run bazel test //src/valdi_modules/src/valdi/valdi_protobuf:valdi_protobuf_web_test. Done when the spec is it and passes.

Written by the indexing model from the issue text.

Description

The spec supports nested map messages in monkey patched js namespace in src/valdi_modules/src/valdi/valdi_protobuf/web/test/NamespaceGenerator.spec.ts is skipped with xit and the comment "Does not yet work".

It creates a test.MapMessage through getTypedMessageNamespace with two map fields:

  • stringToDouble (Map<string, number>)
  • stringToMessage (Map<string, message>)

It expects both fields to come back as Map instances, and the nested value to be a ValdiMessage with its fields set. Map fields, and message values inside maps, aren't supported yet in the web namespace generator.

What to do: add map field support (including message values) to the web protobuf namespace generator in src/valdi_modules/src/valdi/valdi_protobuf/web/, then change xit back to it.

How to run

bazel test //src/valdi_modules/src/valdi/valdi_protobuf:valdi_protobuf_web_test

Done when: the spec runs as it and passes.

See CONTRIBUTING.md before opening a pull request.

Dominant language
C++
Stars
16.4k
Forks
539
PR merge metrics
No merged PRs in 30d

Getting set up

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 Snapchat/Valdi

All issues in Snapchat/Valdi

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.