swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.39k stars 2.18k forks source link

[swagger-jaxrs] Set jsr311 dependency as provided or remove it #2338

Open grimly opened 7 years ago

grimly commented 7 years ago

While this JSR might be used at compile and/or test time, it will most likely conflict with any other dependencies for the JaxRS API either from the javax.ws.rs-api, the javaee-api or the javaee-web-api artifacts.

The workaround would be to exclude it from the project's pom file like below, but that's not what a novice would think about in the first place.

            <dependency>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-jaxrs</artifactId>
                <version>${project.dependency.swagger}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.ws.rs</groupId>
                        <artifactId>jsr311-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
pjfanning commented 7 years ago

it looks like the upcoming swagger 2 release drops support for jsr311 - https://github.com/swagger-api/swagger-core/tree/feature/3.0.0-rc2/modules

grimly commented 7 years ago

I would not consider it a fix, it's even worse if we look at the new swagger-jaxrs2 module. The later depends on Jersey which is an implementation of JaxRS. What happen if we use it on TomEE (uses CXF), Wildfly (uses RestEasy), WebSphere or WebLogic ?

The force of application servers is to let the server handle the implementations and not to have it in your WAR, this module is going the other way.