graphql-java-codegen icon indicating copy to clipboard operation
graphql-java-codegen copied to clipboard

Add annotations to JavaBean getters

Open ludovicc opened this issue 3 years ago • 4 comments

Description

Add nonnull and other annotations to the getter method in addition to the field declaration. Some Java Bean introspection tools can only use annotations declared on the getter/setter methods, not on the private fields, so we need to repeat the annotation that was placed on the field on the getter as well to get full introspection with annotations.


Changes were made to:

  • [x] Codegen library - Java
  • [ ] Codegen library - Kotlin
  • [ ] Codegen library - Scala
  • [ ] Maven plugin
  • [ ] Gradle plugin
  • [ ] SBT plugin

ludovicc avatar Feb 09 '22 01:02 ludovicc

@ludovicc looks good. but could you please change the target branch to develop?

kobylynskyi avatar Feb 09 '22 03:02 kobylynskyi

@ludovicc can you please fix the build?

kobylynskyi avatar Mar 06 '22 12:03 kobylynskyi

Any chance you can fix the build @ludovicc? This would be really useful for me too

JamesPeters98 avatar Jul 14 '22 08:07 JamesPeters98

Actually, I just realised I need this for Setters as well

JamesPeters98 avatar Jul 14 '22 08:07 JamesPeters98