Skip to content

Conversation

@aidandj
Copy link

@aidandj aidandj commented Nov 20, 2025

This is not intended to go in as is, but is some work I started to support a possible upcoming feature that I've been using in a project.

The feature adds unknown field tracking as an option to prost, and does so by adding a public struct member with a configurable name. To make pbjson work correctly with this change, pbjson must be updated to set that struct field to default when constructing.

Protobuf JSON does not maintain unknown fields, so there's no work to do in parsing or data management, just a configurable option that a user can use to set the field they are using with their prost generated code.

I enabled it for testing, and everything passed.

Another option is to just add a boolean unknown_field_support, and then generate a ..Default::default() for the struct creation.

Aidan Jensen added 3 commits December 3, 2025 12:43
Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
@aidandj aidandj force-pushed the aidan/support-unknown-fields branch from 17e6e57 to 1a05be5 Compare December 3, 2025 20:45
Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant