Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off open API specification in production environment

I saw a similar answer for Swagger 2.x here - How do you turn off swagger-ui in production so I was wondering if there is something similar I could do for open API as well? I tried something like :

@Configuration
@Profile("!prod")
public class OpenAPIConfig 
{
}

but this doesn't work. Any thoughts/suggestions?

like image 710
linuxNoob Avatar asked Sep 05 '25 03:09

linuxNoob


1 Answers

May be you can set the below property in prod yaml,

springdoc.api-docs.enabled=false
like image 146
Nagarjuna Adapa Avatar answered Sep 07 '25 15:09

Nagarjuna Adapa