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

Conversation

Projects
None yet
2 participants
@tarkal
Contributor

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 some commits Sep 17, 2014

Tarka L'Herpiniere
Added name to ApiObjectField
Added optional name to ApiObjectField with default to empty string.
Tarka L'Herpiniere
Logical selection of name
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

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Sep 18, 2014

Owner

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

Owner

fabiomaffioletti commented Sep 18, 2014

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