kbuntrock / openapi-maven-plugin

Generate openapi documentation for SpringMVC or JaxRS/JakartaRS projects.
https://kbuntrock.github.io/openapi-maven-plugin/
MIT License
16 stars 12 forks source link

The plugin should probably not depend on spring-core, spring-web, javax.ws.rs-api and javax.servlet-api #170

Open murdos opened 2 weeks ago

murdos commented 2 weeks ago

Excepted for the MergedAnnotations feature, most dependencies could probably be easily removed by replacing classes and enum import by String, e.g. in OperationType:

    GET("GET", "javax.ws.rs.GET", "jakarta.ws.rs.GET"),
    POST("POST", "javax.ws.rs.POST", "jakarta.ws.rs.POST"),

rather than:

    GET(RequestMethod.GET, javax.ws.rs.GET.class, "jakarta.ws.rs.GET"),
    POST(RequestMethod.POST, javax.ws.rs.POST.class, "jakarta.ws.rs.POST"),

This would lower required dependencies, and limit security surface.

And these dependencies should probably be just test dependencies.

kbuntrock commented 1 week ago

I agree, reducing the surface of dependencies has some sweet advantages.

As you mention, the only feature I'm using from Spring is the annotations resolver (I guess located in Spring core). Especially for their custom non standard alias mechanism. And probably for some inheritance resolving too.

Ideally, getting rid of this part would be nice too, but it brings other problems. I have no idea yet if the spring annotation resolver internals are complex or not and if it worth to be re-implemented.

Other than that, I see no issues getting rid of the other dependencies.