The documentation for defining general API information using the quarkus-smallrye-openapi
extension is extremely sparse, and does not explain how to use all the annotations for setting up the openApi generation.
For some background, I am using a clean and largely empty project (quarkus version1.0.1.FINAL
) generated from code.quarkus.io
, with a single class defined as followed (With the attempted @OpenAPIDefinition
annotation):
@OpenAPIDefinition(
info = @Info(
title = "Custom API title",
version = "3.14"
)
)
@Path("/hello")
public class ExampleResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello";
}
}
I have eventually found that general api information (contact info, version, etc) through much digging is defined using the @OpenAPIDefinition
annotation, but when used on my existing endpoint definition, no changes are made to the generated openapi specification. What am I doing wrong?
Try putting the annotation on the JAX-RS Application class. I realize you don't need one of those in a Quarkus application, but I think it doesn't hurt either. For reference in the specification TCK:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments