You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation).||null|
46
+
|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation). Requires library=spring-http-interface and useSpringBoot4=true (Spring Security 7).||null|
47
47
|configPackage|configuration package for generated code||org.openapitools.configuration|
48
48
|containerDefaultToNull|Set containers (array, set, map) default to null||false|
49
49
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value||false|
39
-
|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation).||null|
39
+
|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation). Requires library=spring-http-interface and useSpringBoot4=true (Spring Security 7).||null|
40
40
|configPackage|configuration package for generated code||org.openapitools.configuration|
41
41
|containerDefaultToNull|Set containers (array, set, map) default to null||false|
42
42
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app only)</dd><dt>**legacy**</dt><dd>Legacy java.util.Date</dd><dt>**java8-localdatetime**</dt><dd>Java 8 using LocalDateTime (for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for jdk 1.8+)</dd></dl>|java8|
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -347,7 +347,7 @@ public SpringCodegen() {
347
347
.defaultValue("false")
348
348
);
349
349
cliOptions.add(CliOption.newBoolean(USE_JSPECIFY, "Use Jspecify for null checks", useJspecify));
350
-
cliOptions.add(CliOption.newString(CLIENT_REGISTRATION_ID, "Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation)."));
350
+
cliOptions.add(CliOption.newString(CLIENT_REGISTRATION_ID, "Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation). Requires library=spring-http-interface and useSpringBoot4=true (Spring Security 7)."));
351
351
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
352
352
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
353
353
"Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
@@ -582,6 +582,14 @@ public void processOpts() {
582
582
if (isUseSpringBoot4()) {
583
583
setUseSpringBoot3(false);
584
584
}
585
+
if (isNotEmpty(clientRegistrationId)) {
586
+
if (!SPRING_HTTP_INTERFACE.equals(library)) {
587
+
thrownewIllegalArgumentException(CLIENT_REGISTRATION_ID + " is only supported with the " + SPRING_HTTP_INTERFACE + " library");
588
+
}
589
+
if (!isUseSpringBoot4()) {
590
+
thrownewIllegalArgumentException(CLIENT_REGISTRATION_ID + " requires " + USE_SPRING_BOOT4 + "=true because @ClientRegistrationId is provided by Spring Security 7");
591
+
}
592
+
}
585
593
586
594
if (isUseSpringBoot3() || isUseSpringBoot4()) {
587
595
if (AnnotationLibrary.SWAGGER1.equals(getAnnotationLibrary())) {
Copy file name to clipboardExpand all lines: samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java
Copy file name to clipboardExpand all lines: samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java
0 commit comments