Aaand now I've finally found the answer here: How I can ignore PathVariable conditionally on swagger ui using springdoc openapi
Right now, I'm doing this from the constructor of my SwaggerConfig class, and that works:
@Configuration
@ComponentScan
class SwaggerConfig {
init {
SpringDocUtils.getConfig().addAnnotationsToIgnore(AuthenticatedUser::class.java)
}
.
.
}
Feels a bit smelly to do so statically in a constructor, maybe there's a better place for this?