File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
plugin/src/main/java/com/yelp/codegen Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -175,14 +175,15 @@ abstract class SharedCodegen : DefaultCodegen(), CodegenConfig {
175175 private fun getModelDataType (model : Model ? ): String? {
176176 return when (model) {
177177 is ModelImpl -> {
178- if (model.type == null ) {
179- if (false == model.properties?.isEmpty() || model.additionalProperties != null ) {
178+ if (model.type != null ) {
179+ model.type
180+ } else {
181+ if (false == model.properties?.isEmpty() ||
182+ model.additionalProperties != null ) {
180183 " object"
181184 } else {
182185 null
183186 }
184- } else {
185- model.type
186187 }
187188 }
188189 is RefModel -> toModelName(model.simpleRef)
@@ -210,10 +211,9 @@ abstract class SharedCodegen : DefaultCodegen(), CodegenConfig {
210211 // Deal with composed models (models with allOf) that are meant to override descriptions and
211212 // with references to references
212213 if (model is ComposedModel || model is RefModel ) {
213- val modelDataType = getModelDataType(model)
214- if (modelDataType != null ) {
214+ getModelDataType(model)?.let {
215215 codegenModel.isAlias = true
216- codegenModel.dataType = modelDataType
216+ codegenModel.dataType = it
217217 // This workaround is done to prevent regeneration of enums that would not be used anyway as
218218 // the current codegenModel is a pure type alias
219219 codegenModel.hasEnums = false
You can’t perform that action at this time.
0 commit comments