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
Copy file name to clipboardExpand all lines: docs/generators/java-camel.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
104
104
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.||true|
105
105
|sourceFolder|source folder for generated code||src/main/java|
106
106
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).||null|
107
-
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation. Only applies when library=spring-boot or spring-http-interface.||false|
107
+
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation.||false|
108
108
|testOutput|Set output folder for models and APIs tests||${project.build.directory}/generated-test-sources/openapi|
109
109
|title|server title name or client service name||OpenAPI Spring|
110
110
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).||false|
Copy file name to clipboardExpand all lines: docs/generators/jaxrs-cxf-cdi.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
85
85
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.||false|
86
86
|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.||false|
87
87
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface||false|
88
+
|useQuarkusSecurityAnnotations|Whether to generate Quarkus security annotations (@Authenticated, @RolesAllowed, @PermitAll). Only valid when library is set to quarkus.||false|
88
89
|useSwaggerAnnotations|Whether to generate Swagger annotations.||true|
89
90
|useSwaggerV3Annotations|Whether to generate Swagger v3 (OpenAPI v3) annotations.||false|
90
91
|useTags|use tags for creating interface and controller classnames||false|
Copy file name to clipboardExpand all lines: docs/generators/jaxrs-spec.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
86
86
|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.||false|
87
87
|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.||false|
88
88
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface||false|
89
+
|useQuarkusSecurityAnnotations|Whether to generate Quarkus security annotations (@Authenticated, @RolesAllowed, @PermitAll). Only valid when library is set to quarkus.||false|
89
90
|useSwaggerAnnotations|Whether to generate Swagger annotations.||true|
90
91
|useSwaggerV3Annotations|Whether to generate Swagger v3 (OpenAPI v3) annotations.||false|
91
92
|useTags|use tags for creating interface and controller classnames||false|
Copy file name to clipboardExpand all lines: docs/generators/kotlin-spring.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
58
58
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.||null|
59
59
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.||null|
60
60
|sourceFolder|source folder for generated code||src/main/kotlin|
61
-
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation. Only applies when library=spring-boot or spring-declarative-http-interface.||false|
61
+
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation.||false|
62
62
|title|server title name or client service name||OpenAPI Kotlin Spring|
63
63
|useBeanValidation|Use BeanValidation API annotations to validate data types||true|
64
64
|useFeignClientUrl|Whether to generate Feign client with url parameter.||true|
Copy file name to clipboardExpand all lines: docs/generators/spring.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
97
97
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.||true|
98
98
|sourceFolder|source folder for generated code||src/main/java|
99
99
|springApiVersion|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).||null|
100
-
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation. Only applies when library=spring-boot or spring-http-interface.||false|
100
+
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation.||false|
101
101
|testOutput|Set output folder for models and APIs tests||${project.build.directory}/generated-test-sources/openapi|
102
102
|title|server title name or client service name||OpenAPI Spring|
103
103
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).||false|
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
@@ -147,6 +149,7 @@ public JavaJAXRSSpecServerCodegen() {
147
149
cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string."));
cliOptions.add(CliOption.newBoolean(USE_MUTINY, "Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.", useMutiny));
152
+
cliOptions.add(CliOption.newBoolean(USE_QUARKUS_SECURITY_ANNOTATIONS, "Whether to generate Quarkus security annotations (@Authenticated, @RolesAllowed, @PermitAll). Only valid when library is set to quarkus.", useQuarkusSecurityAnnotations));
150
153
cliOptions.add(CliOption.newBoolean(GENERATE_JSON_CREATOR, "Whether to generate @JsonCreator constructor for required properties.", generateJsonCreator));
151
154
}
152
155
@@ -189,6 +192,10 @@ public void processOpts() {
189
192
convertPropertyToBooleanAndWriteBack(USE_MUTINY, value -> useMutiny = value);
190
193
}
191
194
195
+
if (QUARKUS_LIBRARY.equals(library)) {
196
+
convertPropertyToBooleanAndWriteBack(USE_QUARKUS_SECURITY_ANNOTATIONS, value -> useQuarkusSecurityAnnotations = value);
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -308,7 +308,7 @@ public KotlinSpringServerCodegen() {
308
308
"Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' "
309
309
+ "pagination-metadata property) and replace their generated references with "
310
310
+ "PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata "
311
-
+ "schema are suppressed from code generation. Only applies when library=spring-boot or spring-declarative-http-interface.",
311
+
+ "schema are suppressed from code generation.",
312
312
substituteGenericPagedModel);
313
313
addSwitch(COMPANION_OBJECT, "Whether to generate companion objects in data classes, enabling companion extensions.", companionObject);
314
314
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -380,7 +380,7 @@ public SpringCodegen() {
380
380
"Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' "
381
381
+ "pagination-metadata property) and replace their generated references with "
382
382
+ "PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata "
383
-
+ "schema are suppressed from code generation. Only applies when library=spring-boot or spring-http-interface.",
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -463,6 +463,22 @@ public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs)
463
463
}
464
464
}
465
465
466
+
// Build a set of classnames that are oneOf models (union types)
467
+
Set<String> oneOfModelNames = allModels.stream()
468
+
.filter(m -> !m.oneOf.isEmpty())
469
+
.map(m -> m.classname)
470
+
.collect(Collectors.toSet());
471
+
472
+
// Mark models whose parent is a oneOf model — these cannot use
473
+
// "interface X extends Parent" because TypeScript does not allow
474
+
// an interface to extend a union type. They use
475
+
// "type X = Parent & { ... }" instead.
476
+
for (ExtendedCodegenModelm : allModels) {
477
+
if (m.parent != null && oneOfModelNames.contains(m.parent)) {
478
+
m.parentIsOneOf = true;
479
+
}
480
+
}
481
+
466
482
for (ExtendedCodegenModelrootModel : allModels) {
467
483
for (StringcurImport : rootModel.imports) {
468
484
booleanisModelImport = false;
@@ -1385,6 +1401,7 @@ public ExtendedCodegenProperty(CodegenProperty cp) {
0 commit comments