zhaider
zhaider

Reputation: 665

How to define a global Tag for OpenAPI 3 Spring Doc

I'm using spring-doc to generate open api docs however by default it uses the controller name for tag. I know I can overwrite it with @Tag annotation but is there a way to do it globally for all controllers rather than defining the tag on each of them one by one especially since I want all of them to tagged with the project name?

Upvotes: 0

Views: 2494

Answers (1)

João Dias
João Dias

Reputation: 17510

I haven't tested this, but I expect that you would need to do that programmatically using OpenAPIDefinition.tags(). At least the documentation on the interface Tag states the following:

It can also be used in OpenAPIDefinition.tags() to define spec level tags.

Upvotes: 1

Related Questions