Generating OAS 3 code for both Spring server and client
Asked Answered
F

0

8

I want to build a Maven module using the openapi-generator-maven-plugin to generate both server code and client code from two openapi 3 specs. I want the server code to use Spring boot, so I have these settings:

<generatorName>spring</generatorName>
<library>spring-boot</library>

This works fine and I need io.swagger.core.v3:swagger-annotations and jakarta.validation:jakarta.validation-api for OAS 3 annotations and validation.

However, for the client code, I want to use WebClient from Spring, the only settings I could find was:

<generatorName>java</generatorName>
<library>webclient</library>

The client code generates, but the issue is, it requires the older io.swagger:swagger-annotations and javax.validation:validation-api.

I want to avoid having different sets of libraries. Is there a setting for both the server and client code generations that uses the same set of annotation and validation libraries? Preferably both use io.swagger.core.v3:swagger-annotations and jakarta.validation:jakarta.validation-api.

Fiertz answered 30/5, 2022 at 3:5 Comment(1)
#62916094Obligatory

© 2022 - 2024 — McMap. All rights reserved.