smallrye-open-api icon indicating copy to clipboard operation
smallrye-open-api copied to clipboard

[feat] Annotation composition (for @Consumes)

Open piu130 opened this issue 3 years ago • 1 comments

Could you add support for annotation composition? Example:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Consumes({"image/jpeg", "image/png"})
public @interface ConsumesImages {
}

@Path("/hello")
public class GreetingsResource {

    @GET
    @ConsumesImages
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello RESTEasy";
    }
}

In this example OpenAPI falls back to Content-Type: application/json instead of a dropdown with values image/jpeg and image/png. Haven't tested this with other annotations (only @Consumes).

Btw. an issue template would be nice.

piu130 avatar Jun 07 '22 05:06 piu130

This could be implemented as generic support for composition.

MikeEdgar avatar Aug 15 '22 13:08 MikeEdgar