googleapis / googleapis/librarian
sidekick: a better representation for `Map<K, V>`
- Dominant language
- Go
- Stars
- 45
- Forks
- 61
- Avg merge
- 19h 11m
- Merged PRs (30d)
- 181
Description
Maps are represented as a message with a key and value fields... This is a terrible representation because the codecs constantly find themselves asking "is this a map?" and "what is the key type?" and writing functions or loops to do so.
We should change maps to be top-level entities like `api.Enum` or `api.Message` with their own `Typez` and all.
Then we can simplify the code and (probably) enforce rules such as "a map cannot have a map as key or value".
Contributor guide
Research direction
Start by locating the existing map representation and the codecs that ask whether a value is a map or determine its key type. Compare that design with the top-level api.Enum and api.Message entities and their Typez handling. Done should mean maps have their own representation and Typez, codec logic is simplified, and the stated map key/value rules are enforced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100