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

Don't add @JsonProperty annotation (configurable) #268

Closed
mjparme opened this issue May 31, 2024 · 2 comments
Closed

Don't add @JsonProperty annotation (configurable) #268

mjparme opened this issue May 31, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@mjparme
Copy link

mjparme commented May 31, 2024

It would be nice if there was a configuration option available so we could avoid the redundant @JsonProperty annotation. There is simply no need for the annotation when the value in the annotation is the same as the name of the field. Example:

  @JsonProperty("suffix")
  String suffix

This is simply redundant.

@hauner
Copy link
Member

hauner commented Jun 1, 2024

Yes it is redundant. It was just simpler to add it always instead of checking first if the value is a valid java identifier. 😉

I guess it is not too hard to add now with the latest improvements to the identifier handling.

@hauner hauner added the enhancement New feature or request label Jun 4, 2024
@hauner
Copy link
Member

hauner commented Jun 4, 2024

Maybe this does not need an option. It could auto-detect if the name is a valid identifier (or has set the readOnly/writeOnlyproperty) and just add @JsonProperty when it is needed.

hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit that referenced this issue Jun 16, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
@hauner hauner added this to the core: 2024.5 milestone Jun 16, 2024
@hauner hauner closed this as completed Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants