Generating map<K, V> on javascript type issue
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, nodejs, typescript
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Bắt đầu với trường map .proto được cung cấp và lệnh protoc, sau đó kiểm tra khai báo AsObject MessageResponse .ts được tạo. Tái tạo đầu ra bằng thiết lập master/v3.18 và Node.js đã nêu; hoàn tất khi kiểu map được tạo và cách đặt tên trường khớp với kỳ vọng JavaScript/TypeScript được ghi trong tài liệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What version of protobuf and what language are you using?
Version: master/v3.18
Language: Javascript
What operating system (Linux, Windows, ...) and version? Linux
What runtime / compiler are you using (e.g., python version or gcc version) Nodejs
What did you do?
Steps to reproduce the behavior:
- Trying to export type
map<K, V>so I created aprotofile like this:
message MessageResponse {
string _id = 1;
string title = 2;
bool disabled = 3;
map<string,string> metadata = 4;
}
- Converting it using this some commands like this:
protoc -I=/libraries/protos/ /libraries/protos/src/*.proto /libraries/protos/src/**/*.proto --plugin=/libraries/protos/binaries/linux/protoc-gen-grpc-web --js_out=import_style=commonjs,binary:/libraries/protos/build/typescript --grpc-web_out=import_style=typescript,mode=grpcwebtext:/libraries/protos/build/typescript --experimental_allow_proto3_optional
- What I am getting on
.tsfiles is something like:
export namespace MessageResponse {
export type AsObject = {
id: string,
title: string,
disabled: boolean,
metadataMap: Array<[string, string]>,
}
}
- Well we can see there is a suffix called
Mapadded to my field name! also the generated type isArray<[string, string]>. but what we were expecting, based on language guide here, where an object of{"k": v, …}, likeRecord<string, V>
What did you expect to see
An object like: Record<string, string>
What did you see instead?
Array<[string, string]>
- Ngôn ngữ chính
- JavaScript
- Star
- 471
- Fork
- 91
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của protocolbuffers/protobuf-javascript
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
protocolbuffers/protobuf-javascript#248 · 1 bình luận · 13 reaction ·
-
question
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
protocolbuffers/protobuf-javascript#222 · 9 bình luận ·
-
Why map.js sort keys?Đang mởenhancement port-fix triaged
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
protocolbuffers/protobuf-javascript#185 · 1 bình luận ·
-
enhancement port-fix triaged
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
protocolbuffers/protobuf-javascript#182 · 3 bình luận · 1 reaction ·
Tất cả issue của protocolbuffers/protobuf-javascript
Issue tương tự
-
[quality] coverage gate exits 0 when the test run is killed by a signal (tests/tools/coverage-report.mjs:680 `?? 1` is untested)Có thể đã có người làm @hivecommons-hive đã nhận hôm nay. Đang mởagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
githubnext/gh-aw-workshop#4174 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sendDefaultPii is reported as deprecated on ReactNativeOptions although dataCollection is hiddenĐang mởBug React-Native Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-react-native#6830 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
JuliusBrussee/caveman#1183 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày