79623361

Date: 2025-05-15 12:54:28
Score: 2
Natty:
Report link

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?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
Posted by: UncleBob