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

support deprecation #3

Open
tmc opened this issue Jul 14, 2019 · 3 comments
Open

support deprecation #3

tmc opened this issue Jul 14, 2019 · 3 comments

Comments

@tmc
Copy link

tmc commented Jul 14, 2019

Do you plan to support field metadata such as isDeprecated/deprecationReason?

@marwan-at-work
Copy link
Owner

@tmc yes, I plan on pushing deprecated fields to master sometime tomorrow :)

But how would deprecationReason be translated from protocol buffers? I don't think the protobuf spec supports deprecation reason right? Protoc-gen-go basically just puts do not use as the reason.

@tmc
Copy link
Author

tmc commented Jul 14, 2019

The two options that come to mind are parsing a comment or introducing a protobuf extension to allow supplying structured metadata.

@marwan-at-work
Copy link
Owner

marwan-at-work commented Jul 15, 2019

@tmc I already have a few extensions here which I haven't written documentation for yet.

I think we can add a free-form directive option. Such as:

message X {
  string y = 1 {
    option (twirpql.options.field) = {
      directives = ["@deprecated(reason: whatever)", "@key"]
    }
  };
}

TwirpQL can still support the original deprecated option as well, but it would prioritize the custom inputs

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