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
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
102
102
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.||true|
103
103
|useFeignClientUrl|Whether to generate Feign client with url parameter.||true|
104
104
|useJakartaEe|whether to use Jakarta EE namespace instead of javax||false|
105
+
|useOneOfExtensibleEnums|whether to generate custom extensible enumeration using the extensible enums with interface pattern||false|
105
106
|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|
106
107
|useOptional|Use Optional container for optional parameters||false|
107
108
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition||true|
Copy file name to clipboardExpand all lines: docs/generators/spring.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
@@ -95,6 +95,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
95
95
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.||true|
96
96
|useFeignClientUrl|Whether to generate Feign client with url parameter.||true|
97
97
|useJakartaEe|whether to use Jakarta EE namespace instead of javax||false|
98
+
|useOneOfExtensibleEnums|whether to generate custom extensible enumeration using the extensible enums with interface pattern||false|
98
99
|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|
99
100
|useOptional|Use Optional container for optional parameters||false|
100
101
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition||true|
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,7 @@ public SpringCodegen() {
237
237
cliOptions
238
238
.add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode));
239
239
cliOptions.add(CliOption.newBoolean(SPRING_CONTROLLER, "Annotate the generated API as a Spring Controller", useSpringController));
240
+
cliOptions.add(CliOption.newBoolean(USE_ONE_OF_EXTENSIBLE_ENUMS, "whether to generate custom extensible enumeration using the extensible enums with interface pattern", useOneOfExtensibleEnums));
throw new IllegalArgumentException(value + " not supported in classes " + Arrays.asList({{#interfaceModels}}"{{classname}}"{{^-last}}, {{/-last}}{{/interfaceModels}}));
35
+
{{/useString}}
36
+
}
37
+
38
+
// custom jackson deserializer
39
+
class EnumDeserializer extends StdDeserializer<{{classname}}> {
40
+
41
+
public EnumDeserializer() {
42
+
super({{classname}}.class);
43
+
}
44
+
45
+
@Override
46
+
public {{classname}} deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
47
+
String value = p.readValueAs(String.class);
48
+
return {{classname}}.fromValue(value);
49
+
}
50
+
}
51
+
{{#useString}}
52
+
{{#property.description}}
53
+
/**
54
+
* {{{.}}}
55
+
*/
56
+
{{/property.description}}
57
+
class {{stringClassName}} implements {{classname}} {
0 commit comments