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

[Kotlin] Use mutable container types when 'modelMutable' is enabled #11154

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bin/configs/kotlin-modelMutable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-modelMutable
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-modelMutable
modelMutable: "true"
8 changes: 8 additions & 0 deletions bin/configs/kotlin-server-modelMutable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generatorName: kotlin-server
outputDir: samples/server/petstore/kotlin-server-modelMutable
library: ktor
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-server
additionalProperties:
hideGenerationTimestamp: "true"
modelMutable: "true"
6 changes: 6 additions & 0 deletions bin/configs/kotlin-vertx-modelMutable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: kotlin-vertx
outputDir: samples/server/petstore/kotlin-vertx-modelMutable
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-vertx-server
additionalProperties:
modelMutable: "true"
8 changes: 8 additions & 0 deletions bin/configs/ktorm-schema-modelMutable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generatorName: ktorm-schema
outputDir: samples/schema/petstore/ktorm-modelMutable
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/ktorm-schema
additionalProperties:
hideGenerationTimestamp: true
importModelPackageName: org.openapitools.client.models
modelMutable: "true"
3 changes: 3 additions & 0 deletions docs/generators/kotlin-server-deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
3 changes: 3 additions & 0 deletions docs/generators/kotlin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
3 changes: 3 additions & 0 deletions docs/generators/kotlin-spring.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
3 changes: 3 additions & 0 deletions docs/generators/kotlin-vertx.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
3 changes: 3 additions & 0 deletions docs/generators/kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
3 changes: 3 additions & 0 deletions docs/generators/ktorm-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.MutableList</li>
<li>kotlin.collections.MutableMap</li>
<li>kotlin.collections.MutableSet</li>
<li>kotlin.collections.Set</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ public AbstractKotlinCodegen() {
"kotlin.String",
"kotlin.Array",
"kotlin.collections.List",
"kotlin.collections.MutableList",
"kotlin.collections.Map",
"kotlin.collections.Set"
"kotlin.collections.MutableMap",
"kotlin.collections.Set",
"kotlin.collections.MutableSet"
));

// this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java
Expand Down Expand Up @@ -184,8 +187,11 @@ public AbstractKotlinCodegen() {
"kotlin.Char",
"kotlin.Array",
"kotlin.collections.List",
"kotlin.collections.MutableList",
"kotlin.collections.Set",
"kotlin.collections.Map"
"kotlin.collections.MutableSet",
"kotlin.collections.Map",
"kotlin.collections.MutableMap"
));

typeMapping = new HashMap<>();
Expand Down Expand Up @@ -503,6 +509,16 @@ public void processOpts() {

additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.put("modelDocPath", modelDocPath);

if (isModelMutable()) {
typeMapping.put("list", "kotlin.collections.MutableList");
typeMapping.put("set", "kotlin.collections.MutableSet");
typeMapping.put("map", "kotlin.collections.MutableMap");
}
}

protected boolean isModelMutable() {
return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE));
}

public void setArtifactId(String artifactId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,13 @@ else if (JVM_VOLLEY.equals(getLibrary())){
}

if (CollectionType.LIST.value.equals(collectionType)) {
typeMapping.put("array", "kotlin.collections.List");
typeMapping.put("list", "kotlin.collections.List");
if (isModelMutable()) {
typeMapping.put("array", "kotlin.collections.MutableList");
typeMapping.put("list", "kotlin.collections.MutableList");
} else {
typeMapping.put("array", "kotlin.collections.List");
typeMapping.put("list", "kotlin.collections.List");
}
additionalProperties.put("isList", true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ public CodegenType getTag() {
public void processOpts() {
super.processOpts();

if (isModelMutable()) {
typeMapping.put("array", "kotlin.collections.MutableList");
}

// set default library to "ktor"
if (StringUtils.isEmpty(library)) {
this.setLibrary(DEFAULT_LIBRARY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ public String getHelp() {
public void processOpts() {
super.processOpts();

if (isModelMutable()) {
typeMapping.put("array", "kotlin.collections.MutableList");
typeMapping.put("list", "kotlin.collections.MutableList");
typeMapping.put("set", "kotlin.collections.MutableSet");
typeMapping.put("map", "kotlin.collections.MutableMap");
}

// optional jackson mappings for BigDecimal support
importMapping.put("ToStringSerializer", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer");
importMapping.put("JsonSerialize", "com.fasterxml.jackson.databind.annotation.JsonSerialize");
Expand Down Expand Up @@ -566,6 +573,12 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
resp.code = "200";
}

// This is necessary in case 'modelMutable' is enabled,
// to prevent Spring Request handlers from being generated with
// the ApiResponse annotation configured with the Mutable container type.
// See https://github.com/OpenAPITools/openapi-generator/pull/11154#discussion_r793108068
resp.baseType = getNonMutableContainerTypeIfNeeded(resp.baseType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rm3l could you please explain what this does and why it's needed? Thanks

Copy link
Contributor Author

@rm3l rm3l Jan 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar reasons as in my other comment below.

For example, given the following input operation:

/store/inventory:
    get:
      tags:
        - store
      summary: Returns pet inventories by status
      description: Returns a map of status codes to quantities
      operationId: getInventory
      produces:
        - application/json
      parameters: []
      responses:
        '200':
          description: successful operation
          schema:
            type: object
            additionalProperties:
              type: integer
              format: int32

Without the changes here, this resulted in the following code generated by the kotlin-spring generator:

  • StoreApiController.kt : the Response field in the ApiResponse annotation has changed to MutableMap, which, I guess, is not valid.
diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt
index e2be73b4ec3..ad63efeae2d 100644
--- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt
+++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt
@@ -58,7 +58,7 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
         responseContainer = "Map",
         authorizations = [Authorization(value = "api_key")])
     @ApiResponses(
        value = [ApiResponse(code = 200, message = "successful operation", 
-       response = kotlin.collections.Map::class,
        responseContainer = "Map")])
        value = [ApiResponse(code = 200, message = "successful operation",
+       response = kotlin.collections.MutableMap::class,
        responseContainer = "Map")])
     @RequestMapping(
         method = [RequestMethod.GET],
         value = ["/store/inventory"],

Again, maybe this is not the right approach here or maybe I missed something, but I found no clear way to distinguish between the type mappings used for generating models (Kotlin data classes) and response types in the kotlin-spring generator. Also, since the original issue I reported was more related to model mutability, I thought it would be ok not to change the code generated for the Spring Controllers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining, this way we have an explanation in case we need it 👍


doDataTypeAssignment(resp.dataType, new DataTypeAssigner() {
@Override
public void setReturnType(final String returnType) {
Expand All @@ -579,6 +592,17 @@ public void setReturnContainer(final String returnContainer) {
});
});
}

final List<CodegenParameter> allParams = operation.allParams;
if (allParams != null) {
allParams.forEach(param ->
// This is necessary in case 'modelMutable' is enabled,
// to prevent Spring Request handlers from being generated with
// parameters using their Mutable container types.
// See https://github.com/OpenAPITools/openapi-generator/pull/11154#discussion_r793094727
param.dataType = getNonMutableContainerTypeIfNeeded(param.dataType));
}

doDataTypeAssignment(operation.returnType, new DataTypeAssigner() {

@Override
Expand All @@ -600,6 +624,13 @@ public void setReturnContainer(final String returnContainer) {
return objs;
}

private String getNonMutableContainerTypeIfNeeded(String type) {
if (type != null && type.contains("kotlin.collections.Mutable")) {
return type.replaceAll("kotlin\\.collections\\.Mutable", "kotlin.collections.");
}
return type;
}

private interface DataTypeAssigner {
void setReturnType(String returnType);

Expand All @@ -619,12 +650,24 @@ private void doDataTypeAssignment(final String returnType, DataTypeAssigner data
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.List<".length(), end).trim());
dataTypeAssigner.setReturnContainer("List");
}
} else if (returnType.startsWith("kotlin.collections.MutableList")) {
int end = returnType.lastIndexOf(">");
if (end > 0) {
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.MutableList<".length(), end).trim());
dataTypeAssigner.setReturnContainer("List");
}
} else if (returnType.startsWith("kotlin.collections.Map")) {
int end = returnType.lastIndexOf(">");
if (end > 0) {
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.Map<".length(), end).split(",")[1].trim());
dataTypeAssigner.setReturnContainer("Map");
}
} else if (returnType.startsWith("kotlin.collections.MutableMap")) {
int end = returnType.lastIndexOf(">");
if (end > 0) {
dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.MutableMap<".length(), end).split(",")[1].trim());
dataTypeAssigner.setReturnContainer("Map");
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a case missing for "MutableSet"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @martin-regis could you please open a PR with a fix please?

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ public KtormSchemaCodegen() {
sqlTypeMapping.put("kotlin.ByteArray", SqlType.Blob);
sqlTypeMapping.put("kotlin.Array", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.List", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.MutableList", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.Set", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.MutableSet", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.Map", SqlType.Blob);
sqlTypeMapping.put("kotlin.collections.MutableMap", SqlType.Blob);
sqlTypeMapping.put("kotlin.Any", SqlType.Blob);
sqlTypeMapping.put("java.io.File", SqlType.Blob);
sqlTypeMapping.put("java.math.BigDecimal", SqlType.Decimal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
{{#deprecated}}
@Deprecated(message = "This property is deprecated.")
{{/deprecated}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}
4brunu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
{{#deprecated}}
@Deprecated(message = "This property is deprecated.")
{{/deprecated}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#isUniqueItems}}kotlin.collections.Set{{/isUniqueItems}}{{^isUniqueItems}}kotlin.collections.List{{/isUniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#isUniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/isUniqueItems}}{{^isUniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isUniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
{{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}")
{{/kotlinx_serialization}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}?
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}?
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
{{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}")
{{/kotlinx_serialization}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
Loading