You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Person @annotate(name: "ValidPerson", type: "validator", inputs: {types: [HUSBAND, WIFE]}) {
name: String
}
This is expected to generate a Java class looking like the below:
package com.netflix.graphql.dgs.codegen.tests.generated.types;
import com.test.validator.ValidPerson;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
@ValidPerson(
types = [com.enums.PersonType.HUSBAND, com.enums.PersonType.WIFE]
)
public class Person {
private String name;
// Ignoring other boilerplate code because it is irrelevant to this example.
}
Note that in the build.gradle file, the following has been added:
However, the generated class looks like the below instead:
package com.netflix.graphql.dgs.codegen.tests.generated.types;
import com.enums.PersonType.HUSBAND;
import com.enums.PersonType.WIFE;
import com.test.validator.ValidPerson;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
@ValidPerson(
types = [HUSBAND, WIFE]
)
public class Person {
private String name;
// Ignoring other boilerplate code because it is irrelevant to this example.
}
Since Java expects all enum imports to be static, the above-generated code causes a compile time error.
The text was updated successfully, but these errors were encountered:
The custom annotation follows the below schema:
This is expected to generate a Java class looking like the below:
Note that in the build.gradle file, the following has been added:
However, the generated class looks like the below instead:
Since Java expects all enum imports to be static, the above-generated code causes a compile time error.
The text was updated successfully, but these errors were encountered: