-
-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Discussed in #955
Originally posted by siva54 January 31, 2022
Hi,
I was trying to generate the schema with a List type and came across some issues. As per the schema we have different use cases for a not-null condition for a list,

In my project, I'm using a couple of cases too such as,
[Int!] - This means that the list can be null but cannot have null objects in the list.
[Int]! - This means that the list cannot be null but can have null objects in the list.
When using codegen to generate POJOs, for types with
[Int!]
[Int]!
In both cases, the field is being annotated with,
@javax.validation.constraints.NotNull
This basically means that the List cannot be null. This is incorrect for the type [Int!] and caused some trouble. As of now, I replaced all the NotNull to instead use a PlaceboValidation annotation of mine that does nothing. How do I overcome this and make sure to ensure that the POJO created works as expected?