@@ -177,47 +177,28 @@ open class BeanValidationFactory(
177177}
178178
179179private fun DataType.shouldHaveValid (options : ApiOptions ): Boolean {
180- if (options.beanValidationValidOnReactive) {
181- if (this is SingleDataType )
182- return true
180+ if (this is SingleDataType && options.beanValidationValidOnReactive)
181+ return true
183182
184- if (this is ModelDataType )
185- return true
183+ if (this is ModelDataType )
184+ return true
186185
187- if (this is ArrayDataType )
188- return item is ModelDataType
186+ if (this is ArrayDataType )
187+ return item is ModelDataType
189188
190- if (this is InterfaceDataType )
191- return true
189+ if (this is InterfaceDataType )
190+ return true
192191
193- if (this is MappedCollectionDataType )
194- return multi
195-
196- if (this is MappedSourceDataType ) {
197- return sourceDataType?.shouldHaveValid(options) ? : false
198- }
192+ if (this is MappedCollectionDataType && options.beanValidationValidOnReactive)
193+ return multi
199194
195+ if (this is MappedCollectionDataType )
200196 return false
201197
202- } else {
203- if (this is ModelDataType )
204- return true
205-
206- if (this is ArrayDataType )
207- return item is ModelDataType
208-
209- if (this is InterfaceDataType )
210- return true
211-
212- if (this is MappedCollectionDataType )
213- return false
198+ if (this is MappedSourceDataType )
199+ return sourceDataType?.shouldHaveValid(options) ? : false
214200
215- if (this is MappedSourceDataType ) {
216- return sourceDataType?.shouldHaveValid(options) ? : false
217- }
218-
219- return false
220- }
201+ return false
221202}
222203
223204private fun DataType.isString (): Boolean = this is StringDataType
0 commit comments