[protobuf] Re: Disable log messages

2024-11-07 Thread 'Em Rauch' via Protocol Buffers
I think the function `ParsePartialFromArray()` is what you're looking for. Note that generally you shouldn't rely on this too heavily though; if you serialize such a message and send it to another end point they will be expecting all required fields to be set and may correctly parse fail; the i

Re: [protobuf] How to represent variable JSON data with Proto definition

2024-11-07 Thread 'Em Rauch' via Protocol Buffers
It would be extremely surprising if Struct simply did not work for generically parsing JSON; it's in very wide usage both within and outside of Google. Do you have a reproduction or references to the other people facing issues with it? On Thursday, November 7, 2024 at 5:48:49 AM UTC-5 ayu...@c

Re: [protobuf] How to represent variable JSON data with Proto definition

2024-11-06 Thread 'Em Rauch' via Protocol Buffers
I think what you're looking for is `google.protobuf.Struct details`; Struct is the type which allows any JS object to parse into it and acts like a `map` (including recursively a struct inside if its another JS object in there). On Wed, Nov 6, 2024 at 7:52 AM 'Ayush Shah' via Protocol Buffers < pr

Re: [protobuf] query related to editions

2024-11-04 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
> Q1) with introduction to editions in protobuf, what would be the nature of changes required in other language (like rust or C) plugins? We have documentation about implementing Edition 2023 support in plugins: https://protobuf.dev/editions/implementation/ Edition 2023 primarily is a unification

Re: [protobuf] Can i disable ABSL_* facilities?

2024-10-21 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
> 1. Is it possible to disable or change the behavior of ABSL_LOG(FATAL) and ABSL_CHECK_* macros? > 3. Should i be concerned about this macros in Message and LiteMessage classes? Or it's unlikely that i will ever face them (and further termination)? Protobuf only uses these panic macros sparingly

Re: [protobuf] Defining a static message

2024-09-20 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
Unfortunately the .proto syntax doesn't currently have support for defining arbitrary constants in .proto files. There are various ways you can kinda do it, including making a proto2 syntax file and a message where every field has some default value set, and then in your code just using the default

[protobuf] Re: Suppressing invalid UTF-8 data warnings?

2024-09-10 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
I *think* if you use a proto2 syntax message it actually will not perform this check as of today (only proto3 syntax file). If that's not right, I unfortunately suspect the only way around it would be vendor the protobuf runtime into your codebase and comment out the check / log if its botherin

[protobuf] Re: Suppressing invalid UTF-8 data warnings?

2024-09-05 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
Using non-UTF8 data in a string field should be understood as incorrect, but realistically will work today as long as your messages are only used exactly by C++ Protobuf on the current release of protobuf and only ever with the binary wire format (not textproto or JSON encoding, etc). Today the

Re: [protobuf] Protobuf and gRPC with GCC 14

2024-07-29 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
On the Protobuf side the type signature of AddWarning() was changed with in v22.0 (https://protobuf.dev/support/migration/#error-collector), so I suspect the issue you are hitting is an incompatibility between that gRPC version only supporting Protobuf either before or after v22 (and you're buildin

Re: [protobuf] Compilation error while building libprotobuf-c

2024-07-29 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
OneofDescriptor has had a `file` member; it was added 7 years ago for the 3.4 release. The error sounds like you likely are simply using an ancient version of protobuf with a relatively newer version of `libprotobuf-c` On Mon, Jul 22, 2024 at 11:16 AM Sean wrote: > Hi, > > I'm trying to compile

Re: [protobuf] Dynamic protocol buffer generation in Java

2024-07-18 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
There's no current official support for parsing text-based .proto file contents as a string at runtime in Java. Java Protobuf does support DynamicMessage for certain advanced usecases ( https://protobuf.dev/reference/java/api-docs/com/google/protobuf/DynamicMessage), but it doesn't quite match the

Re: [protobuf] Re: Is using tag numbers in the code - anti-pattern?

2024-07-08 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
I think it's hard to tell all the details from the message, but it seems like you're creating some new form of extensions, perhaps combined with the known pattern of "overlay messages" (which is where a client schema is maintained with a perfect strict subset of fields of the serverside schema, whi

[protobuf] [Announcement] Protocol Buffers Version v27.1 is Released!

2024-06-06 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
You can view the release and complete release notes on GitHub . If you experience any issues with the release, please file a bug or post on the Protocol Buffers forum

Re: [protobuf] Re: Nested Enum with protobuf and rust

2024-05-24 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
The suggestion on stack overflow looks correct: Rust's language enums are "tagged unions", the Protobuf `oneof` feature also acts as a tagged union. Protobuf Enums are intended to be more semantically like C++ enums (which cannot hold values inside). Can you clarify the followup comment "AAOS stan

[protobuf] Re: Unclearness in the specification

2023-10-23 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
This part of the official grammar unfortunately unclear; you may find Buf's reverse engineering of the protobuf grammar to be more clear on this point for your usecase: https://protobuf.com/docs/language-spec On Saturday, October 21, 2023 at 11:43:45 AM UTC-4 Mattias Hansson wrote: > I am curre

[protobuf] Re: Golang Dynamically create Message from .proto files

2023-10-23 Thread &#x27;Em Rauch&#x27; via Protocol Buffers
This exists in Java as DynamicMessage but I believe the equivalent does not exist in the official Go implementation. You may find an OSS implementation that achieves the same (for example https://github.com/bufbuild/prototransform may do what you need). On Saturday, October 21, 2023 at 2:46:45