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
Copy file name to clipboardExpand all lines: docs/codegen-options.md
+6
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,13 @@ See [DirectiveAnnotationsMapping](#option-directiveannotationsmapping)* |
56
56
|`responseProjectionMaxDepth`| Integer | 3 | Sets max depth when use `all$()` which for facilitating the construction of projection automatically, the fields on all projections are provided when it be invoked. This is a global configuration, of course, you can use `all$(max)` to set for each method. For self recursive types, too big depth may result in a large number of returned data!|
57
57
|`generatedLanguage`| Enum | GeneratedLanguage.JAVA | Choose which language you want to generate, Java,Scala,Kotlin were supported. Note that due to language features, there are slight differences in default values between languages.|
58
58
|`generateModelOpenClasses`| Boolean | false | The class type of the generated model. If true, generate normal classes, else generate data classes. It only support in kotlin(```data class```) and scala(```case class```). Maybe we will consider to support Java ```record``` in the future.|
59
+
| `initializeNullableTypes` | Boolean | false | Adds a default null value to nullable arguments. Only supported in Kotlin.
60
+
|`generateSealedInterfaces`| Boolean | false | This applies to generated interfaces on unions and interfaces. If true, generate sealed interfaces, else generate normal ones. It is only supported in Kotlin. |
59
61
|`typesAsInterfaces`| Set(String) | Empty | Types that must generated as interfaces should be defined here in format: `TypeName` or `@directive`. E.g.: `User`, `@asInterface`. |
62
+
|`useObjectMapperForRequestSerialization`| Set(String) | Empty | Fields that require serialization using `com.fasterxml.jackson.databind.ObjectMapper#writeValueAsString(Object)`. Values should be defined here in the following format: `GraphqlObjectName.fieldName` or `GraphqlTypeName`. If just type is specified, then all fields of this type will be serialized using ObjectMapper. E.g.: `["Person.createdDateTime", ZonedDateTime"]`|
63
+
|`supportUnknownFields`| Boolean | false | Specifies whether api classes should support unknown fields during serialization or deserialization. If `true`, classes will include a property of type [`java.util.Map<String,Object>`](https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Map.html) that will store unknown fields.|
64
+
|`unknownFieldsPropertyName`| String | userDefinedFields | Specifies the name of the property to be included in api classes to support unknown fields during serialization or deserialization|
Copy file name to clipboardExpand all lines: plugins/gradle/graphql-java-codegen-gradle-plugin/src/main/java/io/github/kobylynskyi/graphql/codegen/gradle/GraphQLCodegenGradleTask.java
+55
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,11 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
Copy file name to clipboardExpand all lines: plugins/maven/graphql-java-codegen-maven-plugin/src/main/java/io/github/kobylynskyi/graphql/codegen/GraphQLCodegenMojo.java
+45
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,12 @@ public class GraphQLCodegenMojo extends AbstractMojo implements GraphQLCodegenCo
Copy file name to clipboardExpand all lines: plugins/sbt/graphql-java-codegen-sbt-plugin/src/main/scala/io/github/dreamylost/graphql/codegen/GraphQLCodegenKeys.scala
+5
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,8 @@ trait GraphQLCodegenKeys {
124
124
125
125
valgenerateModelOpenClasses= settingKey[Boolean]("The class type of the generated model. If true, generate normal classes, else generate case class.")
126
126
127
+
valgenerateSealedInterfaces= settingKey[Boolean]("If true, generate sealed interfaces for GraphQL unions and interfaces, else generate normal interfaces.")
128
+
127
129
valgenerateJacksonTypeIdResolver= settingKey[Boolean]("Specifies whether generated union interfaces should be annotated with a custom Jackson type id resolver generated in model package")
128
130
129
131
//for version
@@ -133,4 +135,7 @@ trait GraphQLCodegenKeys {
133
135
//some others for sbt
134
136
valgenerateCodegenTargetPath= settingKey[File]("Where to store generated files and add the generated code to the classpath, so that they can be referenced.")
Copy file name to clipboardExpand all lines: plugins/sbt/graphql-java-codegen-sbt-plugin/src/main/scala/io/github/dreamylost/graphql/codegen/GraphQLCodegenPlugin.scala
+9-1
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
Copy file name to clipboardExpand all lines: plugins/sbt/graphql-java-codegen-sbt-plugin/src/sbt-test/graphql-codegen-sbt-plugin/simple/project/plugins.sbt
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
sys.props.get("plugin.version").orElse(Some("5.3.0")) match {
1
+
sys.props.get("plugin.version").orElse(Some("5.4.0")) match {
0 commit comments