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

Ignore deprecated proto types for ADT mapping #146

Open
denis-egorushkin opened this issue Nov 3, 2021 · 2 comments
Open

Ignore deprecated proto types for ADT mapping #146

denis-egorushkin opened this issue Nov 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@denis-egorushkin
Copy link

If an ADT mapping has deprecated messages in the proto (i.e. with option deprecated = true), it would be useful to support deriving the reader mapping, even if the respective model types for the deprecated proto types are missing. Currently, it's not possible if any of the model types are missing. Handling the deprecated proto types could be implemented as returning a PbFailure.

The current behavior does not work well for the use case when there is an existing ADT and some of the cases get deprecated. Then the user is forced to replaced the derived mapping with a custom one.

@denis-egorushkin denis-egorushkin added the enhancement New feature or request label Nov 3, 2021
@jan-xyz
Copy link

jan-xyz commented May 25, 2022

I think there is a misunderstanding of what deprecation means. Deprecation is not removal; Deprecation means it is discouraged to use it (e.g. to signal to users upfront that it will be removed in a next major version). It is still a semantically breaking change to not provide that value or even error out when it is sent. The clean way is to remove the field and bump to the next major version. That being said: I don't think that it is a smart way for teleproto to ignore deprecated fields and messages as that would effectively introduce breaking changes as soon as a field gets deprecated.

@joroKr21
Copy link

Yeah I think you're right - better to err on the side of safety than allow automatically generated code to potentially cause production incidents because e.g. a deprecated message was encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants