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

Optional @ApiObjectField name #31

Merged
merged 2 commits into from Sep 18, 2014
Merged

Optional @ApiObjectField name #31

merged 2 commits into from Sep 18, 2014

Conversation

tarkal
Copy link
Contributor

@tarkal tarkal commented Sep 17, 2014

REST attribute names aren't always the same as the names given in to the object attributes in Java format. For example quite a few people will use Jackson or similar to use JS notation instead of camel.

private String fooBaa;
might be represented in JSON as foo_baa.

I've added an optional name parameter to the @ApiObjectField notation. If a new name is specified it will override the default name otherwise it will simply default back to the actual name.

Tarka L'Herpiniere added 2 commits September 17, 2014 15:34
Added optional name to ApiObjectField with default to empty string.
REST names don't always match the Java standard naming convention. As such you should be able to optionally set the name. In the absence of the name it should default to the field name.
@fabiomaffioletti fabiomaffioletti added this to the 1.0.4 milestone Sep 18, 2014
@fabiomaffioletti fabiomaffioletti self-assigned this Sep 18, 2014
@fabiomaffioletti fabiomaffioletti merged commit 0de3689 into fabiomaffioletti:master Sep 18, 2014
@fabiomaffioletti
Copy link
Owner

Merged but I had to fix compilation errors and add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants