protoc-gen-jsonschema icon indicating copy to clipboard operation
protoc-gen-jsonschema copied to clipboard

Option to ignore deprecated proto fields

Open aurc opened this issue 2 years ago • 1 comments

Hello,

Nice lib! Is there any plans to add an option to ignore deprecated fields on generation, e.g.:

message MyProtoType {
  string id = 1;
  repeated string name = 2; 
  repeated Bar bar = 3 [deprecated=true];
  repeated Foo foo = 4;
}

An option like ignore-deprecated would be very useful !

aurc avatar Sep 05 '22 02:09 aurc

Hello @aurc, funny you should bring this topic up. Back when I was implementing the facility to ignore fields I originally considered using the deprecated=true flag to mark ignored fields. This was mainly because I was being lazy, was trying to avoid implementing my own proto options.

In the end I DID implement my own proto options however, and they're working quite nicely. Does your situation allow you to use the custom proto options in this circumstance?

chrusty avatar Oct 02 '22 22:10 chrusty

I'll close this down for now, feel free to oepn it up again if we've not solved the issue @aurc

chrusty avatar Dec 15 '22 19:12 chrusty