swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

V2 converter depends on javax not jakarta packages

Open dsyer opened this issue 2 years ago • 1 comments

If you try to use the converter in a modern Jakarta-packaged application you get problems with duplicate classes in swagger-core and swagger-annotations. The workaround is to exclude them and depend explicitly on the jakarta-based versions, e.g:

		<dependency>
			<groupId>io.swagger.core.v3</groupId>
			<artifactId>swagger-core-jakarta</artifactId>
			<version>2.2.9</version>
		</dependency>
		<dependency>
			<groupId>io.swagger.parser.v3</groupId>
			<artifactId>swagger-parser-v2-converter</artifactId>
			<version>2.1.16</version>
			<exclusions>
				<exclusion>
					<groupId>io.swagger.core.v3</groupId>
					<artifactId>swagger-core</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.swagger.core.v3</groupId>
					<artifactId>swagger-models</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

This is kind of annoying, even though it's a problem that is created by the core libraries. It seems we need to have a "-jakarta" version of the converter library too?

dsyer avatar Oct 10 '23 08:10 dsyer

Yes we hit that too with Apache Camel. We have to so many exclusions as you say etc. And we can only do this for our own maven modules. But our end user of Camel may bring in their own set, such as jackson-databind that bring in old swagger JARs and whatelse.

davsclaus avatar Feb 29 '24 09:02 davsclaus