jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.7k stars 200 forks source link

Open-api does not parse Avaje BeanScope mvc controllers #3397

Closed kliushnichenko closed 5 months ago

kliushnichenko commented 5 months ago
{
        install(new OpenAPIModule());
        BeanScope beanScope = BeanScope.builder().build();
        mvc(beanScope.get(Controller.class)); // is missing in generated OpenAPI specification 

}
agentgt commented 5 months ago

I am not sure OpenAPI matters or not for this. The issue is there is no avaje inject module.

See this for integration:

https://github.com/agentgt/petclinic/tree/main/petclinic-config/src/main/java/com/adamgent/petclinic/config/jooby

and this in your Main or wherever you boot your app:

https://github.com/agentgt/petclinic/blob/bbd812d40030960695299dbbdd70da3f9f0e3758/petclinic/src/main/java/com/adamgent/petclinic/Application.java#L31 (and the next line).

@jknack and @SentryMan I think we should add an Avaje Inject module as it IMO it is one of the best DI and really fits well into Jooby.