File tree Expand file tree Collapse file tree 1 file changed +10
-23
lines changed
openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java Expand file tree Collapse file tree 1 file changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -177,29 +177,16 @@ open class BeanValidationFactory(
177177}
178178
179179private fun DataType.shouldHaveValid (options : ApiOptions ): Boolean {
180- return if (this is SingleDataType && options.beanValidationValidOnReactive)
181- true
182-
183- else if (this is ModelDataType )
184- true
185-
186- else if (this is ArrayDataType )
187- item is ModelDataType
188-
189- else if (this is InterfaceDataType )
190- true
191-
192- else if (this is MappedCollectionDataType && options.beanValidationValidOnReactive)
193- multi
194-
195- else if (this is MappedCollectionDataType )
196- false
197-
198- else if (this is SourceDataType )
199- sourceDataType?.shouldHaveValid(options) ? : false
200-
201- else
202- false
180+ return when {
181+ this is SingleDataType && options.beanValidationValidOnReactive -> true
182+ this is ModelDataType -> true
183+ this is ArrayDataType -> item is ModelDataType
184+ this is InterfaceDataType -> true
185+ this is MappedCollectionDataType && options.beanValidationValidOnReactive -> multi
186+ this is MappedCollectionDataType -> false
187+ this is SourceDataType -> sourceDataType?.shouldHaveValid(options) ? : false
188+ else -> false
189+ }
203190}
204191
205192private fun DataType.isString (): Boolean = this is StringDataType
You can’t perform that action at this time.
0 commit comments