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

Handle conflicts like private within Java generated models #142

Closed
ay8s opened this issue Jul 3, 2018 · 5 comments
Closed

Handle conflicts like private within Java generated models #142

ay8s opened this issue Jul 3, 2018 · 5 comments
Labels
java starter task Tasks that are straightforward for new contributors

Comments

@ay8s
Copy link
Contributor

ay8s commented Jul 3, 2018

No description provided.

@NightlyNexus
Copy link

Yep, Java keywords can end up in the generated code if they are keys in the JSON scheme, unfortunately.

Since the Java support currently uses Gson, we could do @SerializedName("private") final MyType nonconflicting_private, but I don't know what to name the generated field.
Any ideas?

@maicki
Copy link
Contributor

maicki commented Jul 9, 2018

We may should introduce some way to overwrite the property name which maps over to the property name. We already do something similar (automatic) with properties on Objective-C side I think.

cc @rahul-malik ^ Any thoughts?

@rahul-malik
Copy link
Collaborator

Right now we have a list of reserved words that will get modified to avoid compilation errors. It's specific for objc but we should probably have a list for all languages

@rahul-malik rahul-malik added the starter task Tasks that are straightforward for new contributors label Jul 24, 2018
@rahul-malik
Copy link
Collaborator

@maicki - Tricky part with remapping variable names is things like the interop that we want to have between things like Flow <-> ObjC/Java. I believe we'd want the same name substitutions to apply in all languages which means our list would be the union of all reserved keywords in supported languages.

@rahul-malik
Copy link
Collaborator

@maicki @NightlyNexus @ay8s - This change just landed which will rewrite reserved words for the Java output. #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java starter task Tasks that are straightforward for new contributors
Projects
None yet
Development

No branches or pull requests

4 participants