I am using Spring MVC (via Spring Boot) and have integrated Swagger API documentation using the swagger-spring-mvc library.
I have a class that looks something like
For OpenApi (Swagger 3.0) and SpringDoc the following global configuration could be used.
static { SpringDocUtils.getConfig().replaceWithSchema(Money.class, new StringSchema()); }