Skip to content

Commit 2e6e821

Browse files
Apache Camel Server Generator (#11162)
* Created Apache Camel language * Added unit test * Fix template dir * Fix description api * Camel Dataformat Properties * Apache Camel Doc * Apache Camel Doc * Apache Camel Doc * Apache Camel maven plugin example * Fix LOGGER * Samples * Camel 3.14 * Samples * samples * up to date * Rename camel to java-camel * up to date * Fix SerializedName in modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
1 parent 69b64eb commit 2e6e821

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4092
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
generatorName: java-camel
2+
outputDir: samples/server/petstore/java-camel
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/java-camel-server
5+
additionalProperties:
6+
oas3: "true"
7+
hideGenerationTimestamp: true
8+
camelRestBindingMode: "auto"
9+
performBeanValidation: true
10+
#dateLibrary: "java8-localdatetime"
11+
camelDataformatProperties: "json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS"
12+
library: "spring-boot"
13+
withXml: true
14+
jackson: true
15+
camelUseDefaulValidationtErrorProcessor: true
16+
camelRestClientRequestValidation: true
17+
camelSecurityDefinitions: true

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ The following generators are available:
9797
* [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md)
9898
* [haskell](generators/haskell.md)
9999
* [haskell-yesod (beta)](generators/haskell-yesod.md)
100+
* [java-camel](generators/java-camel.md)
100101
* [java-inflector](generators/java-inflector.md)
101102
* [java-msf4j](generators/java-msf4j.md)
102103
* [java-pkmst](generators/java-pkmst.md)

docs/generators/java-camel.md

Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
---
2+
title: Config Options for java-camel
3+
sidebar_label: java-camel
4+
---
5+
6+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
7+
8+
| Option | Description | Values | Default |
9+
| ------ | ----------- | ------ | ------- |
10+
|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null|
11+
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
12+
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
13+
|apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false|
14+
|apiPackage|package for generated api classes| |org.openapitools.api|
15+
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
16+
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-spring|
17+
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
18+
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
19+
|async|use async Callable controllers| |false|
20+
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
21+
|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false|
22+
|booleanGetterPrefix|Set booleanGetterPrefix| |get|
23+
|camelDataformatProperties|list of dataformat properties separated by comma (propertyName1=propertyValue2,...| ||
24+
|camelRestBindingMode|binding mode to be used by the REST consumer| |auto|
25+
|camelRestClientRequestValidation|enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration| |false|
26+
|camelRestComponent|name of the Camel component to use as the REST consumer| |servlet|
27+
|camelSecurityDefinitions|generate camel security definitions| |true|
28+
|camelUseDefaulValidationtErrorProcessor|generate default validation error processor| |true|
29+
|camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor|
30+
|configPackage|configuration package for generated code| |org.openapitools.configuration|
31+
|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 (if you really have a good reason not to use threetenbp</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+) - note: this also sets &quot;java8&quot; to true</dd><dt>**threetenbp**</dt><dd>Backport of JSR310 (preferred for jdk &lt; 1.8)</dd></dl>|threetenbp|
32+
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
33+
|developerEmail|developer email in generated pom.xml| |team@openapitools.org|
34+
|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors|
35+
|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org|
36+
|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org|
37+
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
38+
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
39+
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
40+
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
41+
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
42+
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
43+
|groupId|groupId in generated pom.xml| |org.openapitools|
44+
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|
45+
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
46+
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
47+
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
48+
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
49+
|invokerPackage|root package for generated code| |org.openapitools.api|
50+
|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used. IMPORTANT: This option has been deprecated as Java 8 is the default.</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd></dl>|true|
51+
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
52+
|library|library template (sub-template)|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application using the SpringFox integration.</dd><dt>**spring-mvc**</dt><dd>Spring-MVC Server application using the SpringFox integration.</dd><dt>**spring-cloud**</dt><dd>Spring-Cloud-Feign client with Spring-Boot auto-configured settings.</dd></dl>|spring-boot|
53+
|licenseName|The name of the license| |Unlicense|
54+
|licenseUrl|The URL of the license| |http://unlicense.org|
55+
|modelPackage|package for generated models| |org.openapitools.model|
56+
|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false|
57+
|openApiNullable|Enable OpenAPI Jackson Nullable library| |true|
58+
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
59+
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
60+
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
61+
|performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false|
62+
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
63+
|reactive|wrap responses in Mono/Flux Reactor types (spring-boot only)| |false|
64+
|responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null|
65+
|returnSuccessCode|Generated server returns 2xx code| |false|
66+
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
67+
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
68+
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
69+
|serializableModel|boolean - toggle &quot;implements Serializable&quot; for generated models| |false|
70+
|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false|
71+
|skipDefaultInterface|Whether to generate default implementations for java8 interfaces| |false|
72+
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
73+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
74+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
75+
|sourceFolder|source folder for generated code| |src/main/java|
76+
|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false|
77+
|title|server title name or client service name| |OpenAPI Spring|
78+
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
79+
|useBeanValidation|Use BeanValidation API annotations| |true|
80+
|useOptional|Use Optional container for optional parameters| |false|
81+
|useSpringController|Annotate the generated API as a Spring Controller| |false|
82+
|useTags|use tags for creating interface and controller classnames| |false|
83+
|virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false|
84+
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
85+
86+
## IMPORT MAPPING
87+
88+
| Type/Alias | Imports |
89+
| ---------- | ------- |
90+
|Array|java.util.List|
91+
|ArrayList|java.util.ArrayList|
92+
|BigDecimal|java.math.BigDecimal|
93+
|Date|java.util.Date|
94+
|DateTime|org.joda.time.*|
95+
|File|java.io.File|
96+
|HashMap|java.util.HashMap|
97+
|LinkedHashSet|java.util.LinkedHashSet|
98+
|List|java.util.*|
99+
|LocalDate|org.joda.time.*|
100+
|LocalDateTime|org.joda.time.*|
101+
|LocalTime|org.joda.time.*|
102+
|Map|java.util.Map|
103+
|Set|java.util.*|
104+
|Timestamp|java.sql.Timestamp|
105+
|URI|java.net.URI|
106+
|UUID|java.util.UUID|
107+
108+
109+
## INSTANTIATION TYPES
110+
111+
| Type/Alias | Instantiated By |
112+
| ---------- | --------------- |
113+
|array|ArrayList|
114+
|map|HashMap|
115+
|set|LinkedHashSet|
116+
117+
118+
## LANGUAGE PRIMITIVES
119+
120+
<ul class="column-ul">
121+
<li>Boolean</li>
122+
<li>Double</li>
123+
<li>Float</li>
124+
<li>Integer</li>
125+
<li>Long</li>
126+
<li>Object</li>
127+
<li>String</li>
128+
<li>boolean</li>
129+
<li>byte[]</li>
130+
</ul>
131+
132+
## RESERVED WORDS
133+
134+
<ul class="column-ul">
135+
<li>abstract</li>
136+
<li>apiclient</li>
137+
<li>apiexception</li>
138+
<li>apiresponse</li>
139+
<li>assert</li>
140+
<li>boolean</li>
141+
<li>break</li>
142+
<li>byte</li>
143+
<li>case</li>
144+
<li>catch</li>
145+
<li>char</li>
146+
<li>class</li>
147+
<li>configuration</li>
148+
<li>const</li>
149+
<li>continue</li>
150+
<li>default</li>
151+
<li>do</li>
152+
<li>double</li>
153+
<li>else</li>
154+
<li>enum</li>
155+
<li>extends</li>
156+
<li>final</li>
157+
<li>finally</li>
158+
<li>float</li>
159+
<li>for</li>
160+
<li>goto</li>
161+
<li>if</li>
162+
<li>implements</li>
163+
<li>import</li>
164+
<li>instanceof</li>
165+
<li>int</li>
166+
<li>interface</li>
167+
<li>localreturntype</li>
168+
<li>localvaraccept</li>
169+
<li>localvaraccepts</li>
170+
<li>localvarauthnames</li>
171+
<li>localvarcollectionqueryparams</li>
172+
<li>localvarcontenttype</li>
173+
<li>localvarcontenttypes</li>
174+
<li>localvarcookieparams</li>
175+
<li>localvarformparams</li>
176+
<li>localvarheaderparams</li>
177+
<li>localvarpath</li>
178+
<li>localvarpostbody</li>
179+
<li>localvarqueryparams</li>
180+
<li>long</li>
181+
<li>native</li>
182+
<li>new</li>
183+
<li>null</li>
184+
<li>object</li>
185+
<li>package</li>
186+
<li>private</li>
187+
<li>protected</li>
188+
<li>public</li>
189+
<li>return</li>
190+
<li>short</li>
191+
<li>static</li>
192+
<li>strictfp</li>
193+
<li>stringutil</li>
194+
<li>super</li>
195+
<li>switch</li>
196+
<li>synchronized</li>
197+
<li>this</li>
198+
<li>throw</li>
199+
<li>throws</li>
200+
<li>transient</li>
201+
<li>try</li>
202+
<li>void</li>
203+
<li>volatile</li>
204+
<li>while</li>
205+
</ul>
206+
207+
## FEATURE SET
208+
209+
210+
### Client Modification Feature
211+
| Name | Supported | Defined By |
212+
| ---- | --------- | ---------- |
213+
|BasePath|✓|ToolingExtension
214+
|Authorizations|✗|ToolingExtension
215+
|UserAgent|✗|ToolingExtension
216+
|MockServer|✗|ToolingExtension
217+
218+
### Data Type Feature
219+
| Name | Supported | Defined By |
220+
| ---- | --------- | ---------- |
221+
|Custom|✗|OAS2,OAS3
222+
|Int32|✓|OAS2,OAS3
223+
|Int64|✓|OAS2,OAS3
224+
|Float|✓|OAS2,OAS3
225+
|Double|✓|OAS2,OAS3
226+
|Decimal|✓|ToolingExtension
227+
|String|✓|OAS2,OAS3
228+
|Byte|✓|OAS2,OAS3
229+
|Binary|✓|OAS2,OAS3
230+
|Boolean|✓|OAS2,OAS3
231+
|Date|✓|OAS2,OAS3
232+
|DateTime|✓|OAS2,OAS3
233+
|Password|✓|OAS2,OAS3
234+
|File|✓|OAS2
235+
|Array|✓|OAS2,OAS3
236+
|Maps|✓|ToolingExtension
237+
|CollectionFormat|✓|OAS2
238+
|CollectionFormatMulti|✓|OAS2
239+
|Enum|✓|OAS2,OAS3
240+
|ArrayOfEnum|✓|ToolingExtension
241+
|ArrayOfModel|✓|ToolingExtension
242+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
243+
|ArrayOfCollectionOfModel|✓|ToolingExtension
244+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
245+
|MapOfEnum|✓|ToolingExtension
246+
|MapOfModel|✓|ToolingExtension
247+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
248+
|MapOfCollectionOfModel|✓|ToolingExtension
249+
|MapOfCollectionOfEnum|✓|ToolingExtension
250+
251+
### Documentation Feature
252+
| Name | Supported | Defined By |
253+
| ---- | --------- | ---------- |
254+
|Readme|✓|ToolingExtension
255+
|Model|✓|ToolingExtension
256+
|Api|✓|ToolingExtension
257+
258+
### Global Feature
259+
| Name | Supported | Defined By |
260+
| ---- | --------- | ---------- |
261+
|Host|✓|OAS2,OAS3
262+
|BasePath|✓|OAS2,OAS3
263+
|Info|✓|OAS2,OAS3
264+
|Schemes|✗|OAS2,OAS3
265+
|PartialSchemes|✓|OAS2,OAS3
266+
|Consumes|✓|OAS2
267+
|Produces|✓|OAS2
268+
|ExternalDocumentation|✓|OAS2,OAS3
269+
|Examples|✓|OAS2,OAS3
270+
|XMLStructureDefinitions|✓|OAS2,OAS3
271+
|MultiServer|✗|OAS3
272+
|ParameterizedServer|✗|OAS3
273+
|ParameterStyling|✗|OAS3
274+
|Callbacks|✗|OAS3
275+
|LinkObjects|✗|OAS3
276+
277+
### Parameter Feature
278+
| Name | Supported | Defined By |
279+
| ---- | --------- | ---------- |
280+
|Path|✓|OAS2,OAS3
281+
|Query|✓|OAS2,OAS3
282+
|Header|✓|OAS2,OAS3
283+
|Body|✓|OAS2
284+
|FormUnencoded|✓|OAS2
285+
|FormMultipart|✓|OAS2
286+
|Cookie|✗|OAS3
287+
288+
### Schema Support Feature
289+
| Name | Supported | Defined By |
290+
| ---- | --------- | ---------- |
291+
|Simple|✓|OAS2,OAS3
292+
|Composite|✓|OAS2,OAS3
293+
|Polymorphism|✓|OAS2,OAS3
294+
|Union|✗|OAS3
295+
296+
### Security Feature
297+
| Name | Supported | Defined By |
298+
| ---- | --------- | ---------- |
299+
|BasicAuth|✓|OAS2,OAS3
300+
|ApiKey|✓|OAS2,OAS3
301+
|OpenIDConnect|✗|OAS3
302+
|BearerToken|✗|OAS3
303+
|OAuth2_Implicit|✓|OAS2,OAS3
304+
|OAuth2_Password|✓|OAS2,OAS3
305+
|OAuth2_ClientCredentials|✓|OAS2,OAS3
306+
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
307+
308+
### Wire Format Feature
309+
| Name | Supported | Defined By |
310+
| ---- | --------- | ---------- |
311+
|JSON|✓|OAS2,OAS3
312+
|XML|✓|OAS2,OAS3
313+
|PROTOBUF|✗|ToolingExtension
314+
|Custom|✓|OAS2,OAS3

0 commit comments

Comments
 (0)