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

Can I choose the fields that was auto generated? #43

Open
lianggx6 opened this issue Aug 17, 2023 · 5 comments
Open

Can I choose the fields that was auto generated? #43

lianggx6 opened this issue Aug 17, 2023 · 5 comments

Comments

@lianggx6
Copy link

lianggx6 commented Aug 17, 2023

I have a message like this.
I want to generate the custom for the 'operator' and 'article_id' , but I do not want to generate for the app_token because it is Sensitive Data.
And I am too lazy to define every tag's name. I want to use the auto funtion to generate the camel as name except the filed 'app_token'.
Can we support the auto generate for this message? for the filed that I define the tag, auto generate using the camel. For the other fileds, just ignore.

message UpdateArticleAuthReq{  
  string app_token = 1;                                               
  string operator = 2   [(tagger.tags) = "jsonlog"];          
  int64  article_id = 3 [(tagger.tags) = "jsonlog"];                
}
@Kavuti
Copy link
Collaborator

Kavuti commented May 10, 2024

Is this issue still relevant?
Me, @ucpr and @mesmerx are embracing the project and planning both maintenance and evolution, so we would like to tidy up everything before working on new features. If the issue is not relevant anymore or we don't get a response in a few days, it will be closed, until we are ready to work on it.

@lianggx6
Copy link
Author

Is this issue still relevant? Me, @ucpr and @mesmerx are embracing the project and planning both maintenance and evolution, so we would like to tidy up everything before working on new features. If the issue is not relevant anymore or we don't get a response in a few days, it will be closed, until we are ready to work on it.

YES!!! I am waiting this feature

@mesmerx
Copy link
Collaborator

mesmerx commented May 27, 2024

i dont get exatcly what you want, if you want to ignore the tag you can add the - to the json tags
maybe even using
https://github.com/srikrsna/protoc-gen-gotag?tab=readme-ov-file#add-tags-to-xxx-fields
if you want to add the snake/camel to any tag you can use
https://github.com/srikrsna/protoc-gen-gotag?tab=readme-ov-file#auto-add-tags-on-field

but if you want to APPEND a tag to the created ones, i afraid its not possible AFAIK, not without a huge rework (that we are planning to do)
if you give details maybe i can create a code to handle this with some workaround for you

@lianggx6
Copy link
Author

i dont get exatcly what you want, if you want to ignore the tag you can add the - to the json tags maybe even using https://github.com/srikrsna/protoc-gen-gotag?tab=readme-ov-file#add-tags-to-xxx-fields if you want to add the snake/camel to any tag you can use https://github.com/srikrsna/protoc-gen-gotag?tab=readme-ov-file#auto-add-tags-on-field

but if you want to APPEND a tag to the created ones, i afraid its not possible AFAIK, not without a huge rework (that we are planning to do) if you give details maybe i can create a code to handle this with some workaround for you

The function I want is a little like the "auto-add-tags-on-field" feature. But "auto-add-tags-on-field" will add tags on all fields。I want it just add tag on the field that I marked. Just like a field white list。The fields in white list will be added tags automatically, others not.

@mesmerx
Copy link
Collaborator

mesmerx commented Jun 1, 2024

this feature right now its not possible if i understand correctly, you need to manually add the tags control that, but in future we will have a plan for that
its ok so we can close as we gonna plan this ?

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

3 participants