Open judu opened 5 years ago
I'd also like this for code reuse, but for methods.
Instead of:
@Operation(
operationId = "getOccurrenceById",
summary = "Occurrence by id",
description = "...",
extensions = @Extension(
name = "Category",
properties = @ExtensionProperty(name = "Level", value = "Basic")
)
)
public ...
where the same extension is repeated on many methods, I'd be able to define an annotation:
@Target({METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Extension(
name = "Category",
properties = @ExtensionProperty(name = "Level", value = "Basic")
)
@interface CategoryLevelBasic {}
and use that:
@Operation(
operationId = "getOccurrenceById",
summary = "Occurrence by id",
description = "..."
)
@CategoryLevelBasic
public ...
Hi,
We are working on our (jersey) client generation. We wish to use extensions to document "services". A service is a set of paths around the same type of resources. When we generate our client, we want to generate an "addon" service, an "organisation" service, an "invoice" service, etc.
We can add an
x-service
extension to each and every method, but that would be a lot of replicated code. So I'm trying to be smart ;)I saw that
@Extensions
can be applied to classes. I added that to my class:When I generate the swagger, there is no mention of
x-service
anywhere.We think that using
@Extension
on classes (which is allowed by the definition of that annotation) should add the extension to all operations in that class.What do you think? If this is not the use case, then what is the use of
@Extension
on classes?