Skip to content

Commit 0cdd9f8

Browse files
committed
simpler
1 parent b9cf0a7 commit 0cdd9f8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/writer/java/BeanValidationFactory.kt‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ open class BeanValidationFactory(
233233
}
234234

235235
private fun DataType.shouldHaveValid(options: ApiOptions): Boolean {
236-
return when {
237-
this is SingleDataType && options.beanValidationValidOnReactive -> true
238-
this is ModelDataType -> true
239-
this is ArrayDataType -> item is ModelDataType
240-
this is InterfaceDataType -> true
241-
this is MappedCollectionDataType && options.beanValidationValidOnReactive -> multi
242-
this is MappedCollectionDataType -> false
243-
this is SourceDataType -> sourceDataType?.shouldHaveValid(options) ?: false
236+
return when (this) {
237+
is SingleDataType if options.beanValidationValidOnReactive -> true
238+
is ModelDataType -> true
239+
is ArrayDataType -> item is ModelDataType
240+
is InterfaceDataType -> true
241+
is MappedCollectionDataType if options.beanValidationValidOnReactive -> multi
242+
is MappedCollectionDataType -> false
243+
is SourceDataType -> sourceDataType?.shouldHaveValid(options) ?: false
244244
else -> false
245245
}
246246
}

0 commit comments

Comments
 (0)