Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: allow specifying attributes for oneof fields #609

Open
wmdrichards opened this issue Mar 22, 2022 · 1 comment
Open

Feature request: allow specifying attributes for oneof fields #609

wmdrichards opened this issue Mar 22, 2022 · 1 comment

Comments

@wmdrichards
Copy link

wmdrichards commented Mar 22, 2022

Currently it is possible to add attributes to oneof fields using either field_attributes or type_attributes, but it requires explicit knowledge of all of the oneof field paths. One of the major stumbling blocks in adding serde attributes to prost outputs in order to serialize/deserialize from json (longstanding issue: #75) is getting serde(flatten) and serde(rename_all="snake_case") onto all oneof enums. This could be made much easier via the addition of oneof_field_attributes and oneof_type_attributes configuration options, which would allow usage of "." as the path pattern. I believe that many, if not all, of these use cases could be handled in this way without prost having to explicitly support json ser/deserialization

@LucioFranco
Copy link
Member

I think that is possibly and option, I am not really happy with the current way that we support field/type attributes. I'd be happy for someone to champion this as I won't have much time to get to this anytime soon.

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

No branches or pull requests

2 participants