I have a situation when I would like to hard-code a request header called test-header
which will store simple JSON data {"username":"swagger", "email":"dummy@email"}
.
So the users who will use Swagger UI to make requests won't need to add this data manually, it will always be automatically added to each request sent from Swagger UI.
I am using org.springdoc
with Spring Boot v3. And currently I just have simple OpenAPI bean:
@Bean
public OpenAPI customOpenAPI(@Value("${springdoc.version}") String appVersion) {
return new OpenAPI()
.info(new Info().title("Person API").version(appVersion)
.license(new License().name("Apache 2.0").url("http://springdoc.org")));
};
Is there a possibility to add it somehow to it? Or am I fated to use a filter/interceptor?