I want to design a proto3 message from this Cesium class:Cesium Class. It is an array containing [string, double, double, double]. Is there anyway to do this?
Is there a way to have an array of multiple types in proto3?
2.5k Views Asked by stephenjk41 At
2
There are 2 best solutions below
Related Questions in PROTOCOL-BUFFERS
- Custom rewriter for json
- Cannot resolve method 'merge(String, Builder)' on JsonFormat after upgrading protobuf-java-util from 3.25.3 -> 4.26.0
- "No map fields found in com.google.cloud.compute.v1.Instance" error when getting instances in Google Cloud API Java
- How can I decode a Protocol Buffer that uses NanoPB?
- Is it possible to add a "this is what you should use" message when deprecating a Protocol buffer field?
- File passthrough in Meson project
- Least Connection Load balancing using Grpc
- Fatal Exception: java.lang.VerifyError when using Datastore with my own data class on some devices
- using gdscript procotcol buffers
- Use google.api.field_behavior with protoc-gen-ts_proto
- Unmarshalling json into protobuf having oneof type
- How can I export Pub/Sub messages using a Protobuf schema to a GCS bucket?
- Whats the proper way to fill a recyclerView with data from a proto datastore
- Having shared swagger (openapi) type definitions alongside with protobuf ones
- Errors with reading GTFS tripupdates.pb real time data using get() function
Related Questions in PROTO
- Issues linting protos with Buf
- Import multiple protobuf files with common message names in a single proto file
- stream two event messages in one from gRPC Server
- google-protobuf - Can't find variable: proto
- How to get several proto datastore instances?
- NYC MTA Subway API How to Get Next Trains At a Specific Station going a Specific Direction
- Error while generating grpc files (--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.)
- What is the memory difference between serializing a value as string and serializing a value as other data type in protobuf
- Generated proto files not found in docker container, but found in local machine
- GCP Python SDK TypeError: Value must be iterable
- Converting Go []interface{} to protobuf Repeated Array
- gRPC - Needs equivalent proto syntax Map<String, Object>
- Rust Tonic gRPC "transport error" / " Kind(BrokenPipe)" only when running in Docker
- /* in transcoding from HTTP to gRPC
- protobuf options - how to enforce "use only these data types" in the .proto file
Related Questions in PROTO3
- Enforce requiredness with email validation rules?
- Protobuf partial serialization of common fields in Java
- Proto3 implicit field presence
- gRPC and Protobuf - How and Where the Efficiency is Achieved as part of Building/Binding?
- protobuf webhook with no fixed request structure
- Defined proto enum types cannot generate corresponding enum classes after compilation [python]
- `proto3-json-serializer` doesn't map protobuf messages to proto3 json objects properly
- Do we have Future Datatype in Protobuf
- Proto3 reusing field options
- Defining a single RPC with both a streaming and unary response
- In proto3, can validate.rules enforce requiredness? Or do they only apply when the field is supplied. Or does it depend
- How to collate several protobuf messages into one object
- How to serialize protobuf from json with auto ignoring unknown fields in c#?
- Could I reuse an existing protobuf binary, when marshaling a message including it?(protobuf3)
- grpc-gateway removed omitempty tag from generated json tags, but empty fields are still not returned
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I don't believe you can create arbitrarily long messages like those shown in your link because your client and server must agree on the number and order of fields before transfer.
[Time, Longitude, Latitude, Height, Time, Longitude, Latitude, Height, ...]Problem: without pre-defining many field numbers, how do I pass this many fields?
Option 1
Instead, you can create your own message type to represent a single instance:
Then use the custom type as a field. Here the
repeatedkeyword indicates that you can send more than oneCartographicRadiansin theCartographicRadiansArray.Option 2
Another approach would be to create a self-recursive message which would function closer to the stream-like format described above.