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
Change variable name if it start with underscore. #116
Comments
@comigor |
In scrope of this issue I would like to cover the issue when variable is called like the Dart keyword. I have an example of this edge case in enum on previous project
The |
To sum up: All items that start with underscore will be replaced by
All items matching the Dart keywords will be prepended with
If you agree with this approach I'll implement it. |
@vasilich6107 that seems the way to go! |
Small update. I suggest to prepend dart keywords with |
I think that's ok, but following this mindset, there can be both I think I would just bail on fields matching keywords, suggesting to use aliases instead, but that opinion may be unpopular. |
As I wrote previously
|
oops, sorry, forgot about that message yep, that seems better than the bug we have today |
I do not think that you can alias the enum item in this case)
|
The aliasing could always be a fallback when somebody would not like the |
Hi @TarekkMA
|
Closed by #142 |
I am having a issue in this renaming I am quering mongodb using graphql , so IDs are like '_id' These _id converted to $id , like you said But it also sending query in renamed variable like {$id: 5f660d7a929072166f5addb2} So I am getting exception the variable not supplied But if I manually gave variables in WatchQueryOptions as {'_id': 5f660d7a929072166f5addb2} , query working ... Pls help me Code
|
I’ll check |
Works fine as you see with latest |
i already using 6.12.3-beta.2 ...But toJson printing $id only The implementation in generated class is only having $id for both fromJson and toJson GraphQL query:
|
Please create a separate issue and fill it according to template |
yeah here |
Bug description
Fields starting with underscore cause issues since dart can't have private named parameters.
In the mutation/query I can alias field name to avoid the problem with fields starting with underscore. But in the input I can't do the same.
I think this issue can be solved by checking for underscore in the field name and using
@JsonKey(name:"noUnderScoreName")
to mitigate the issueSpecs
Artemis version: '>=5.0.0 <6.0.0'
The text was updated successfully, but these errors were encountered: