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

DataObject property name #348

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hammettj
Copy link

@hammettj hammettj commented Oct 4, 2022

As I'm constantly dealing with JSON documents which contain Java keywords or illegal characters I always have to work around this problem. This might not be a problem for a handful of classes but gets very time-consuming, error-prone and complex if you have to support multiple versions of a data exchange protocol or similar.

There have been several attempts to add per-property naming for DataObjects from different developers, but none of those made it to master.

With this Pull Request it would be possible to annotate a specific property like so:

@DataObject.Property(":ref")
public String getRef() {
    return ref;
}

The generated converter will then pick up the specified property name instead of the default one determined by the jsonPropertyNameFormatter.

@hammettj hammettj changed the title Dataobject property name DataObject property name Oct 4, 2022
@hammettj hammettj force-pushed the dataobject-property-name branch from 303aedd to 5b2ce9c Compare October 4, 2022 17:06
@hammettj hammettj requested a review from vietj October 13, 2022 15:22
@hammettj
Copy link
Author

Hello @vietj. I'm sorry to bother you. I just wanted to ask if you already had a chance to take a look at the changes?

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

Successfully merging this pull request may close these issues.

2 participants