ArrayIndexOutOfBounds with Kotlin coroutines and Hibernate-Validator

I was trying to build a spring boot application based on spring spring-boot-starter-webflux which is based on kotlinx-coroutines-reactor. The API definition was done with OpenAPI-Generator with “kotlin-spring” generator and “spring-boot” library. Setting the configOptions useBeanValidation and reactive to true generates suspendable methods and uses webflux. And adding hibernate-validator allows to use bean validation for every request. Perfect. But trying the API for the first time ended in ArrayIndexOutOfBounds and it took me a while to find the reason until i found the following thread https://github.com/spring-projects/spring-framework/issues/23499. In the conversation pschichtel posted a workaround that worked perfectly so far. You can find his classes under this link:

https://gist.github.com/pschichtel/830b7943ea43b7cb58cadd984b54b903

Thx for the solution!