smallrye-open-api
smallrye-open-api copied to clipboard
[feat] Annotation composition (for @Consumes)
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.
This could be implemented as generic support for composition.