Skip to content

Commit 91d2b14

Browse files
committed
feat: add serialization library support for Jackson 3 in Java client
1 parent eeab1dd commit 91d2b14

1 file changed

Lines changed: 36 additions & 72 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java

Lines changed: 36 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
4848
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
4949
import static java.util.Collections.sort;
50+
import static org.openapitools.codegen.CodegenConstants.SERIALIZATION_LIBRARY;
5051
import static org.openapitools.codegen.CodegenConstants.X_IMPLEMENTS;
5152
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
5253
import static org.openapitools.codegen.utils.StringUtils.camelize;
@@ -131,87 +132,50 @@ public class JavaClientCodegen extends AbstractJavaCodegen
131132
protected boolean useRxJava3 = false;
132133
// backwards compatibility for openapi configs that specify neither rx1 nor rx2
133134
// (mustache does not allow for boolean operators so we need this extra field)
134-
@Setter
135-
protected boolean doNotUseRx = true;
136-
@Setter
137-
protected boolean usePlayWS = false;
138-
@Setter
139-
protected String microprofileFramework = MICROPROFILE_DEFAULT;
140-
@Setter
141-
protected String microprofileRestClientVersion = MICROPROFILE_REST_CLIENT_DEFAULT_VERSION;
142-
@Setter
143-
protected boolean microprofileMutiny = false;
144-
@Setter
145-
protected boolean microProfileGlobalExceptionMapper = true;
146-
@Setter
147-
protected boolean microProfileRegisterExceptionMapper = true;
148-
@Setter
149-
protected String configKey = null;
150-
@Setter(AccessLevel.PRIVATE)
151-
protected boolean configKeyFromClassName = false;
152-
@Setter
153-
protected boolean asyncNative = false;
154-
@Setter
155-
protected boolean parcelableModel = false;
156-
@Setter
157-
protected boolean performBeanValidation = false;
158-
@Setter
159-
protected boolean useGzipFeature = false;
160-
@Setter
161-
protected boolean useRuntimeException = false;
162-
@Setter
163-
protected boolean useReflectionEqualsHashCode = false;
135+
@Setter protected boolean doNotUseRx = true;
136+
@Setter protected boolean usePlayWS = false;
137+
@Setter protected String microprofileFramework = MICROPROFILE_DEFAULT;
138+
@Setter protected String microprofileRestClientVersion = MICROPROFILE_REST_CLIENT_DEFAULT_VERSION;
139+
@Setter protected boolean microprofileMutiny = false;
140+
@Setter protected boolean microProfileGlobalExceptionMapper = true;
141+
@Setter protected boolean microProfileRegisterExceptionMapper = true;
142+
@Setter protected String configKey = null;
143+
@Setter(AccessLevel.PRIVATE) protected boolean configKeyFromClassName = false;
144+
@Setter protected boolean asyncNative = false;
145+
@Setter protected boolean parcelableModel = false;
146+
@Setter protected boolean performBeanValidation = false;
147+
@Setter protected boolean useGzipFeature = false;
148+
@Setter protected boolean useRuntimeException = false;
149+
@Setter protected boolean useReflectionEqualsHashCode = false;
164150
protected boolean caseInsensitiveResponseHeaders = false;
165-
@Setter
166-
protected boolean useAbstractionForFiles = false;
167-
@Setter
168-
protected boolean dynamicOperations = false;
169-
@Setter
170-
protected boolean supportStreaming = false;
171-
@Setter
172-
protected boolean withAWSV4Signature = false;
173-
@Setter
174-
protected String gradleProperties;
175-
@Setter
176-
protected String errorObjectType;
177-
@Getter
178-
@Setter
179-
protected boolean failOnUnknownProperties = false;
180-
@Setter
181-
protected boolean supportVertxFuture = false;
182-
@Setter
183-
protected boolean useSealedOneOfInterfaces = false;
184-
@Setter
185-
protected boolean useUnaryInterceptor = false;
151+
@Setter protected boolean useAbstractionForFiles = false;
152+
@Setter protected boolean dynamicOperations = false;
153+
@Setter protected boolean supportStreaming = false;
154+
@Setter protected boolean withAWSV4Signature = false;
155+
@Setter protected String gradleProperties;
156+
@Setter protected String errorObjectType;
157+
@Getter @Setter protected boolean failOnUnknownProperties = false;
158+
@Setter protected boolean supportVertxFuture = false;
159+
@Setter protected boolean useSealedOneOfInterfaces = false;
160+
@Setter protected boolean useUnaryInterceptor = false;
186161

187162
protected String authFolder;
188163
/**
189164
* Serialization library.
190165
*/
191-
@Getter
192-
protected String serializationLibrary = null;
193-
@Getter
194-
@Setter
195-
protected boolean useSpringBoot4 = false;
196-
@Getter
197-
@Setter
198-
protected boolean useJackson3 = false;
199-
@Setter
200-
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
166+
@Getter protected String serializationLibrary = null;
167+
@Getter @Setter protected boolean useSpringBoot4 = false;
168+
@Getter @Setter protected boolean useJackson3 = false;
169+
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
201170
protected String rootJavaEEPackage;
202171
protected Map<String, MpRestClientVersion> mpRestClientVersions = new LinkedHashMap<>();
203-
@Setter(AccessLevel.PRIVATE)
204-
protected String useSingleRequestParameter = "false";
172+
@Setter(AccessLevel.PRIVATE) protected String useSingleRequestParameter = "false";
205173
protected boolean webclientBlockingOperations = false;
206-
@Setter
207-
protected boolean generateClientAsBean = false;
208-
@Setter
209-
protected boolean useEnumCaseInsensitive = false;
210-
211-
@Setter
212-
protected int maxAttemptsForRetry = 1;
213-
@Setter
214-
protected long waitTimeMillis = 10l;
174+
@Setter protected boolean generateClientAsBean = false;
175+
@Setter protected boolean useEnumCaseInsensitive = false;
176+
177+
@Setter protected int maxAttemptsForRetry = 1;
178+
@Setter protected long waitTimeMillis = 10l;
215179

216180
private static class MpRestClientVersion {
217181
public final String rootPackage;

0 commit comments

Comments
 (0)