@team-supercharge/oasg 13.0.0-angular-16-730fa73f.0 → 13.0.0-java-upgrade-1d8b5fad.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +26 -6
  2. package/bin/oasg +7 -6
  3. package/config.schema.yml +15 -0
  4. package/package.json +1 -1
  5. package/targets/feign/generator-config.json +3 -3
  6. package/targets/feign/templates/beanValidation.mustache +2 -7
  7. package/targets/feign/templates/formParams.mustache +2 -1
  8. package/targets/feign/templates/libraries/spring-cloud/clientConfiguration.mustache +118 -0
  9. package/targets/feign/templates/libraries/spring-cloud/pom-sb3.mustache +16 -16
  10. package/targets/feign/templates/libraries/spring-cloud/pom.mustache +16 -16
  11. package/targets/feign-kotlin/generator-config.json +3 -3
  12. package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb3.mustache +2 -1
  13. package/targets/flutter/generate.sh +22 -0
  14. package/targets/flutter/generator-config.json +8 -0
  15. package/targets/flutter/publish.sh +26 -0
  16. package/targets/ios/generate.sh +1 -0
  17. package/targets/ios/generator-config.json +7 -0
  18. package/targets/ios/publish.sh +1 -1
  19. package/targets/python/generator-config.json +6 -1
  20. package/targets/spring/generator-config.json +3 -3
  21. package/targets/spring/templates/libraries/spring-boot/pom-sb3.mustache +247 -0
  22. package/targets/spring/templates/libraries/spring-boot/pom.mustache +257 -0
  23. package/targets/spring-kotlin/generator-config.json +3 -3
  24. package/targets/spring-kotlin/templates/libraries/spring-boot/pom-sb3.mustache +0 -1
  25. package/targets/spring-kotlin/templates/libraries/spring-boot/pom.mustache +0 -1
  26. package/targets/feign-kotlin/templates/libraries/dataClassReqVar.mustache +0 -5
  27. package/targets/feign-kotlin/templates/libraries/spring-cloud/apiInterface.mustache +0 -108
  28. package/targets/spring-kotlin/templates/dataClassReqVar.mustache +0 -5
package/README.md CHANGED
@@ -481,8 +481,7 @@ Common target parameters
481
481
  "type": "stubby",
482
482
  "source": "source-merged",
483
483
  "generateWithDocker": "true",
484
- "repository": "registry.supercharge.io/misc/oasg-example",
485
- "generator": "https://gitlab.supercharge.io/misc/openapi-generator-sc/-/package_files/225/download"
484
+ "repository": "registry.supercharge.io/misc/oasg-example"
486
485
  }
487
486
  ```
488
487
 
@@ -606,7 +605,6 @@ TBD
606
605
  "generatorId": "swift5",
607
606
  "source": "source-merged",
608
607
  "projectName": "OASgExample",
609
- "generator": "https://gitlab.supercharge.io/misc/openapi-generator-sc/-/package_files/348/download",
610
608
  "repository": "git@gitlab.supercharge.io:example/openapi-generator-source.git",
611
609
  "interfaceType": "Combine",
612
610
  "generatorCustomArgs": "--model-name-suffix=ApiModel"
@@ -620,6 +618,25 @@ TBD
620
618
  | interfaceType | Response type of the generated client: `Combine` / `Result` / `RxSwift` / `AsyncAwait` / `PromiseKit` | Y | - |
621
619
  | generatorCustomArgs | Custom arguments of the generator | N | - |
622
620
 
621
+ #### `flutter`
622
+
623
+ ```json
624
+ {
625
+ "id": "client-flutter",
626
+ "type": "flutter",
627
+ "source": "source-merged",
628
+ "packageName": "OASgExample",
629
+ "repository": "git@gitlab.supercharge.io:example/openapi-generator-source.git",
630
+ "generatorCustomArgs": "--model-name-suffix=ApiModel"
631
+ }
632
+ ```
633
+
634
+ |Parameter| Description| Required | Default |
635
+ |-|-|-|-|
636
+ | packageName | Name of the package | Y | - |
637
+ | repository | URL of the generated client api code repository | Y | - |
638
+ | generatorCustomArgs | Custom arguments of the generator | N | - |
639
+
623
640
  #### `python`
624
641
 
625
642
  ```json
@@ -762,15 +779,18 @@ This section covers the breaking changes and their migrations across major versi
762
779
 
763
780
  ## From `12.x.x` to `13.0.0`
764
781
 
765
- ### Schema naming updates in `angular` target
782
+ ### Schema naming updates in `angular`, `python`, `ios` targets
766
783
 
767
784
  With the update to [OpenAPI Generator 7.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.0) the same breaking changes appear as in other targets before:
768
785
 
769
- * `ARRAY_ITEM_SUFFIX` and `MAP_ITEM_SUFFIX` variables has been set to empty strings
770
- - generated inline classes won't have the default `...Inner` suffix from now on
771
786
  * [Inline Schema Naming in `spring-kotlin`, `spring` and `feign`](#inline-schema-naming-in-spring-kotlin-spring-and-feign)
772
787
  * [Skip Reusing Schemas in `spring-kotlin`, `spring` and `feign`](#skip-reusing-schemas-in-spring-kotlin-spring-and-feign)
773
788
 
789
+ and more:
790
+
791
+ * `ARRAY_ITEM_SUFFIX` and `MAP_ITEM_SUFFIX` variables has been set to empty strings
792
+ - generated inline classes won't have the default `...Inner` suffix from now on
793
+
774
794
  ### Breaking in `angular` target
775
795
 
776
796
  * the default `ngVersion` parameter is set to `16.0.0` if you wish to specify another version, use e.g `"generatorCustomArgs": "-p ngVersion=12"` in your `config.json`
package/bin/oasg CHANGED
@@ -35,15 +35,16 @@ const DEFAULT_GENERATOR_MAPPING = {
35
35
  // client targets
36
36
  "android": { version: '6.6.0', generator: 'kotlin' },
37
37
  "angular": { version: '7.0.0', generator: 'typescript-angular' },
38
- "feign": { version: '6.6.0', generator: 'spring' },
39
- "feign-kotlin": { version: '6.6.0', generator: 'kotlin-spring' },
40
- "ios": { version: '4.3.1', generator: 'swift5' },
41
- "python": { version: '6.6.0', generator: 'python-nextgen' },
38
+ "feign": { version: '7.0.0', generator: 'spring' },
39
+ "feign-kotlin": { version: '7.0.0', generator: 'kotlin-spring' },
40
+ "flutter": { version: '7.0.0', generator: 'dart-dio' },
41
+ "ios": { version: '7.0.0', generator: 'swift5' },
42
+ "python": { version: '7.0.0', generator: 'python' },
42
43
  "react-native": { version: '4.3.1', generator: 'typescript-fetch' },
43
44
  // server targets
44
45
  "nestjs": { version: '5.4.0', generator: 'typescript-angular' },
45
- "spring": { version: '6.6.0', generator: 'spring' },
46
- "spring-kotlin": { version: '6.6.0', generator: 'kotlin-spring' },
46
+ "spring": { version: '7.0.0', generator: 'spring' },
47
+ "spring-kotlin": { version: '7.0.0', generator: 'kotlin-spring' },
47
48
  // misc targets
48
49
  "contract-testing": { version: '4.3.1', generator: 'typescript-node' },
49
50
  "openapi": { version: undefined, generator: undefined },
package/config.schema.yml CHANGED
@@ -23,6 +23,7 @@ properties:
23
23
  - $ref: '#/targets/ContractTesting'
24
24
  - $ref: '#/targets/NestJS'
25
25
  - $ref: '#/targets/OpenAPI'
26
+ - $ref: '#/targets/Flutter'
26
27
  required:
27
28
  - targets
28
29
  additionalProperties: false
@@ -331,6 +332,20 @@ targets:
331
332
  fileName:
332
333
  type: string
333
334
 
335
+ Flutter:
336
+ allOf:
337
+ - $ref: '#/targets/Base'
338
+ - properties:
339
+ type:
340
+ pattern: "^flutter$"
341
+ packageName:
342
+ type: string
343
+ repository:
344
+ type: string
345
+ required:
346
+ - packageName
347
+ - repository
348
+
334
349
  definitions:
335
350
  # default
336
351
  SourceOverrides:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "13.0.0-angular-16-730fa73f.0",
3
+ "version": "13.0.0-java-upgrade-1d8b5fad.0",
4
4
  "description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
5
5
  "author": "Supercharge",
6
6
  "license": "MIT",
@@ -17,9 +17,9 @@
17
17
  "java.time.OffsetDateTime": "java.time.Instant",
18
18
  "java.util.Date": "java.time.LocalDate"
19
19
  },
20
- "inlineSchemaNameDefaults": {
21
- "arrayItemSuffix": "",
22
- "mapItemSuffix": "",
20
+ "inlineSchemaOptions": {
21
+ "ARRAY_ITEM_SUFFIX": "",
22
+ "MAP_ITEM_SUFFIX": "",
23
23
  "SKIP_SCHEMA_REUSE": "true"
24
24
  }
25
25
  }
@@ -1,7 +1,2 @@
1
- {{! https://github.com/OpenAPITools/openapi-generator/pull/5960 }}
2
- {{#required}}{{^isReadOnly}}{{^isNullable}}
3
- @NotNull{{/isNullable}}{{/isReadOnly}}
4
- {{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}
5
- @Valid{{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}
6
- @Valid{{/isPrimitiveType}}{{/isContainer}}
7
- {{>beanValidationCore}}
1
+ {{! only add @NotNull if property not nullable }}
2
+ {{#required}}{{^isReadOnly}}{{^isNullable}}@NotNull {{/isNullable}}{{/isReadOnly}}{{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}@Valid {{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}@Valid {{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}}
@@ -1,2 +1,3 @@
1
- {{! https://github.com/OpenAPITools/openapi-generator/issues/7794 }}
1
+ {{! annotate RequestPart instead of RequestParam when model is not array }}
2
+ {{! add bean validation conditinally if param is file }}
2
3
  {{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}@RequestPart{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}}
@@ -0,0 +1,118 @@
1
+ {{! import ConditionalOnProperty if any auth methods are anbled }}
2
+ package {{configPackage}};
3
+
4
+ {{#authMethods}}
5
+ {{#isBasicBasic}}
6
+ import feign.auth.BasicAuthRequestInterceptor;
7
+ {{^hasApiKeyMethods}}
8
+ import org.springframework.beans.factory.annotation.Value;
9
+ {{/hasApiKeyMethods}}
10
+ {{/isBasicBasic}}
11
+ {{/authMethods}}
12
+ {{#hasAuthMethods}}
13
+ import org.springframework.context.annotation.Bean;
14
+ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
15
+ {{#hasApiKeyMethods}}
16
+ import org.springframework.beans.factory.annotation.Value;
17
+ {{/hasApiKeyMethods}}
18
+ {{#hasOAuthMethods}}
19
+ import org.springframework.security.authentication.AnonymousAuthenticationToken;
20
+ import org.springframework.security.oauth2.client.AuthorizedClientServiceOAuth2AuthorizedClientManager;
21
+ import org.springframework.security.oauth2.client.OAuth2AuthorizeRequest;
22
+ import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
23
+ import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
24
+ import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService;
25
+ import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
26
+ import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
27
+ import org.springframework.security.oauth2.core.OAuth2AccessToken;
28
+ import org.springframework.security.core.authority.AuthorityUtils;
29
+ import org.springframework.http.HttpHeaders;
30
+
31
+ import feign.RequestInterceptor;
32
+ import feign.RequestTemplate;
33
+
34
+ {{/hasOAuthMethods}}
35
+ {{/hasAuthMethods}}
36
+ import org.springframework.context.annotation.Configuration;
37
+
38
+
39
+ @Configuration
40
+ public class ClientConfiguration {
41
+
42
+ {{#authMethods}}
43
+ {{#isBasicBasic}}
44
+ @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username:{{closebrace}}")
45
+ private String {{{name}}}Username;
46
+
47
+ @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.password:{{closebrace}}")
48
+ private String {{{name}}}Password;
49
+
50
+ @Bean
51
+ @ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username")
52
+ public BasicAuthRequestInterceptor {{{name}}}RequestInterceptor() {
53
+ return new BasicAuthRequestInterceptor(this.{{{name}}}Username, this.{{{name}}}Password);
54
+ }
55
+
56
+ {{/isBasicBasic}}
57
+ {{#isApiKey}}
58
+ @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key:{{closebrace}}")
59
+ private String {{{name}}}Key;
60
+
61
+ @Bean
62
+ @ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key")
63
+ public ApiKeyRequestInterceptor {{{name}}}RequestInterceptor() {
64
+ return new ApiKeyRequestInterceptor({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{{keyParamName}}}", this.{{{name}}}Key);
65
+ }
66
+
67
+ {{/isApiKey}}
68
+ {{#isOAuth}}
69
+ private static final String CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}} = "oauth2FeignClient";
70
+
71
+ @Bean
72
+ @ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", name = "enabled", havingValue = "true" )
73
+ public OAuth2RequestInterceptor {{{flow}}}OAuth2RequestInterceptor(final OAuth2AuthorizedClientManager {{{flow}}}AuthorizedClientManager ) {
74
+ return new OAuth2RequestInterceptor(OAuth2AuthorizeRequest.withClientRegistrationId("{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}")
75
+ .principal( new AnonymousAuthenticationToken( CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}}, CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}}, AuthorityUtils.createAuthorityList( "ROLE_ANONYMOUS" ) ) )
76
+ .build(), {{{flow}}}AuthorizedClientManager );
77
+ }
78
+
79
+ @Bean
80
+ @ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", name = "enabled", havingValue = "true" )
81
+ public OAuth2AuthorizedClientManager {{{flow}}}AuthorizedClientManager(ClientRegistrationRepository clientRegistrationRepository,
82
+ OAuth2AuthorizedClientService authorizedClientService ) {
83
+ return new AuthorizedClientServiceOAuth2AuthorizedClientManager( clientRegistrationRepository, authorizedClientService );
84
+ }
85
+ {{/isOAuth}}
86
+ {{/authMethods}}
87
+ {{#hasOAuthMethods}}
88
+ public static class OAuth2RequestInterceptor implements RequestInterceptor {
89
+
90
+ private final OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager;
91
+ private final OAuth2AuthorizeRequest oAuth2AuthorizeRequest;
92
+
93
+ public OAuth2RequestInterceptor(OAuth2AuthorizeRequest oAuth2AuthorizeRequest,OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager){
94
+ this.oAuth2AuthorizeRequest = oAuth2AuthorizeRequest;
95
+ this.oAuth2AuthorizedClientManager = oAuth2AuthorizedClientManager;
96
+ }
97
+
98
+ @Override
99
+ public void apply( final RequestTemplate template ) {
100
+ template.header( HttpHeaders.AUTHORIZATION, getBearerToken() );
101
+ }
102
+
103
+ public OAuth2AccessToken getAccessToken() {
104
+ final OAuth2AuthorizedClient authorizedClient = oAuth2AuthorizedClientManager.authorize(oAuth2AuthorizeRequest);
105
+ if (authorizedClient == null) {
106
+ throw new OAuth2AuthenticationException( "Client failed to authenticate");
107
+ }
108
+ return authorizedClient.getAccessToken();
109
+ }
110
+
111
+ public String getBearerToken() {
112
+ final OAuth2AccessToken accessToken = getAccessToken();
113
+ return String.format( "%s %s", accessToken.getTokenType().getValue(), accessToken.getTokenValue() );
114
+ }
115
+ }
116
+ {{/hasOAuthMethods}}
117
+
118
+ }
@@ -16,7 +16,7 @@
16
16
  {{/springDocDocumentationProvider}}
17
17
  {{^springDocDocumentationProvider}}
18
18
  {{#swagger2AnnotationLibrary}}
19
- <swagger-annotations.version>}2.2.7</swagger-annotations.version>
19
+ <swagger-annotations.version>2.2.7</swagger-annotations.version>
20
20
  {{/swagger2AnnotationLibrary}}
21
21
  {{/springDocDocumentationProvider}}
22
22
  </properties>
@@ -47,18 +47,18 @@
47
47
  <build>
48
48
  <sourceDirectory>src/main/java</sourceDirectory>
49
49
  <plugins>
50
- <plugin>
51
- <groupId>org.apache.maven.plugins</groupId>
52
- <artifactId>maven-source-plugin</artifactId>
53
- <executions>
54
- <execution>
55
- <id>attach-sources</id>
56
- <goals>
57
- <goal>jar</goal>
58
- </goals>
59
- </execution>
60
- </executions>
61
- </plugin>
50
+ <plugin>
51
+ <groupId>org.apache.maven.plugins</groupId>
52
+ <artifactId>maven-source-plugin</artifactId>
53
+ <executions>
54
+ <execution>
55
+ <id>attach-sources</id>
56
+ <goals>
57
+ <goal>jar</goal>
58
+ </goals>
59
+ </execution>
60
+ </executions>
61
+ </plugin>
62
62
  </plugins>
63
63
  </build>
64
64
 
@@ -107,10 +107,10 @@
107
107
  <artifactId>spring-cloud-starter-openfeign</artifactId>
108
108
  </dependency>
109
109
  <dependency>
110
- <groupId>org.springframework.cloud</groupId>
111
- <artifactId>spring-cloud-starter-oauth2</artifactId>
110
+ <groupId>org.springframework.security</groupId>
111
+ <artifactId>spring-security-oauth2-client</artifactId>
112
112
  {{^parentOverridden}}
113
- <version>2.2.5.RELEASE</version>
113
+ <version>6.1.1</version>
114
114
  {{/parentOverridden}}
115
115
  </dependency>
116
116
  {{#withXml}}
@@ -23,7 +23,7 @@
23
23
  <swagger-annotations.version>1.6.6</swagger-annotations.version>
24
24
  {{/swagger1AnnotationLibrary}}
25
25
  {{#swagger2AnnotationLibrary}}
26
- <swagger-annotations.version>}2.2.7</swagger-annotations.version>
26
+ <swagger-annotations.version>2.2.7</swagger-annotations.version>
27
27
  {{/swagger2AnnotationLibrary}}
28
28
  {{/springDocDocumentationProvider}}
29
29
  {{/springFoxDocumentationProvider}}
@@ -46,18 +46,18 @@
46
46
  <build>
47
47
  <sourceDirectory>src/main/java</sourceDirectory>
48
48
  <plugins>
49
- <plugin>
50
- <groupId>org.apache.maven.plugins</groupId>
51
- <artifactId>maven-source-plugin</artifactId>
52
- <executions>
53
- <execution>
54
- <id>attach-sources</id>
55
- <goals>
56
- <goal>jar</goal>
57
- </goals>
58
- </execution>
59
- </executions>
60
- </plugin>
49
+ <plugin>
50
+ <groupId>org.apache.maven.plugins</groupId>
51
+ <artifactId>maven-source-plugin</artifactId>
52
+ <executions>
53
+ <execution>
54
+ <id>attach-sources</id>
55
+ <goals>
56
+ <goal>jar</goal>
57
+ </goals>
58
+ </execution>
59
+ </executions>
60
+ </plugin>
61
61
  </plugins>
62
62
  </build>
63
63
 
@@ -123,10 +123,10 @@
123
123
  <artifactId>spring-cloud-starter-openfeign</artifactId>
124
124
  </dependency>
125
125
  <dependency>
126
- <groupId>org.springframework.cloud</groupId>
127
- <artifactId>spring-cloud-starter-oauth2</artifactId>
126
+ <groupId>org.springframework.security</groupId>
127
+ <artifactId>spring-security-oauth2-client</artifactId>
128
128
  {{^parentOverridden}}
129
- <version>2.2.5.RELEASE</version>
129
+ <version>5.7.8</version>
130
130
  {{/parentOverridden}}
131
131
  </dependency>
132
132
  {{#withXml}}
@@ -18,9 +18,9 @@
18
18
  "java.time.OffsetDateTime": "java.time.Instant",
19
19
  "java.util.Date": "java.time.LocalDate"
20
20
  },
21
- "inlineSchemaNameDefaults": {
22
- "arrayItemSuffix": "",
23
- "mapItemSuffix": "",
21
+ "inlineSchemaOptions": {
22
+ "ARRAY_ITEM_SUFFIX": "",
23
+ "MAP_ITEM_SUFFIX": "",
24
24
  "SKIP_SCHEMA_REUSE": "true"
25
25
  }
26
26
  }
@@ -1,5 +1,6 @@
1
1
  {{! attach sources }}
2
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
4
  <modelVersion>4.0.0</modelVersion>
4
5
  <groupId>{{groupId}}</groupId>
5
6
  <artifactId>{{artifactId}}</artifactId>
@@ -0,0 +1,22 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ rm -rf out/$targetId
6
+ mkdir -p out/$targetId
7
+
8
+ java -jar $binary generate \
9
+ -g $generatorId \
10
+ -i $openApiFile \
11
+ -t $templateDir \
12
+ -o out/$targetId \
13
+ -c $(dirname "$0")/generator-config.json \
14
+ -ppubLibrary=$packageName \
15
+ -ppubName=$packageName \
16
+ -ppubRepository=$repository \
17
+ -ppubVersion=$version $generatorCustomArgs
18
+
19
+ cd out/$targetId
20
+ dart pub get
21
+ dart run build_runner build
22
+ cd ..
@@ -0,0 +1,8 @@
1
+ {
2
+ "serializationLibrary": "json_serializable",
3
+ "inlineSchemaOptions": {
4
+ "ARRAY_ITEM_SUFFIX": "",
5
+ "MAP_ITEM_SUFFIX": "",
6
+ "SKIP_SCHEMA_REUSE": "true"
7
+ }
8
+ }
@@ -0,0 +1,26 @@
1
+ #/bin/bash
2
+
3
+ source $(dirname "$0")/../common.sh
4
+
5
+ cd out
6
+ git clone $repository generator-source
7
+ rm -rf generator-source/$packageName
8
+ cp -rf $targetId/* generator-source
9
+
10
+ cd generator-source
11
+ if [ $(git status --porcelain | wc -l) -eq "0" ]; then
12
+ echo "🟢 No changes"
13
+ else
14
+ git add .
15
+ git commit -m "chore(release): $version"
16
+
17
+ if [ "$preRelease" == "false" ]; then git push; fi
18
+
19
+ tagVersion="v$version"
20
+ git tag -f $tagVersion
21
+ git push origin -f --tags
22
+ fi
23
+
24
+ cd ..
25
+ rm -rf generator-source
26
+ cd ../..
@@ -10,5 +10,6 @@ java -jar $binary generate \
10
10
  -i $openApiFile \
11
11
  -t $templateDir \
12
12
  -o out/$targetId \
13
+ -c $(dirname "$0")/generator-config.json \
13
14
  -pprojectName=$projectName \
14
15
  -presponseAs=$interfaceType $generatorCustomArgs
@@ -0,0 +1,7 @@
1
+ {
2
+ "inlineSchemaOptions": {
3
+ "ARRAY_ITEM_SUFFIX": "",
4
+ "MAP_ITEM_SUFFIX": "",
5
+ "SKIP_SCHEMA_REUSE": "true"
6
+ }
7
+ }
@@ -14,7 +14,7 @@ else
14
14
  git add .
15
15
  git commit -m "chore(release): $version"
16
16
 
17
- if [ "$preRelease" == "false" ]; then git push origin master; fi
17
+ if [ "$preRelease" == "false" ]; then git push; fi
18
18
 
19
19
  tagVersion="v$version"
20
20
  git tag -f $tagVersion
@@ -1,3 +1,8 @@
1
1
  {
2
- "library": "urllib3"
2
+ "library": "urllib3",
3
+ "inlineSchemaOptions": {
4
+ "ARRAY_ITEM_SUFFIX": "",
5
+ "MAP_ITEM_SUFFIX": "",
6
+ "SKIP_SCHEMA_REUSE": "true"
7
+ }
3
8
  }
@@ -18,9 +18,9 @@
18
18
  "importMappings": {
19
19
  "java.time.OffsetDateTime": "java.time.Instant"
20
20
  },
21
- "inlineSchemaNameDefaults": {
22
- "arrayItemSuffix": "",
23
- "mapItemSuffix": "",
21
+ "inlineSchemaOptions": {
22
+ "ARRAY_ITEM_SUFFIX": "",
23
+ "MAP_ITEM_SUFFIX": "",
24
24
  "SKIP_SCHEMA_REUSE": "true"
25
25
  }
26
26
  }
@@ -0,0 +1,247 @@
1
+ {{! attach sources }}
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>{{groupId}}</groupId>
5
+ <artifactId>{{artifactId}}</artifactId>
6
+ <packaging>jar</packaging>
7
+ <name>{{artifactId}}</name>
8
+ <version>{{artifactVersion}}</version>
9
+ <properties>
10
+ <java.version>17</java.version>
11
+ <maven.compiler.source>${java.version}</maven.compiler.source>
12
+ <maven.compiler.target>${java.version}</maven.compiler.target>
13
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14
+ {{#springDocDocumentationProvider}}
15
+ <springdoc.version>2.0.2</springdoc.version>
16
+ {{/springDocDocumentationProvider}}
17
+ {{^springDocDocumentationProvider}}
18
+ {{#swagger2AnnotationLibrary}}
19
+ <swagger-annotations.version>}2.2.7</swagger-annotations.version>
20
+ {{/swagger2AnnotationLibrary}}
21
+ {{/springDocDocumentationProvider}}
22
+ {{#useSwaggerUI}}
23
+ <swagger-ui.version>4.15.5</swagger-ui.version>
24
+ {{/useSwaggerUI}}
25
+ {{#virtualService}}
26
+ <virtualan.version>2.5.2</virtualan.version>
27
+ {{/virtualService}}
28
+ </properties>
29
+ {{#parentOverridden}}
30
+ <parent>
31
+ <groupId>{{{parentGroupId}}}</groupId>
32
+ <artifactId>{{{parentArtifactId}}}</artifactId>
33
+ <version>{{{parentVersion}}}</version>
34
+ </parent>
35
+ {{/parentOverridden}}
36
+ {{^parentOverridden}}
37
+ <parent>
38
+ <groupId>org.springframework.boot</groupId>
39
+ <artifactId>spring-boot-starter-parent</artifactId>
40
+ <version>3.0.0</version>
41
+ <relativePath/> <!-- lookup parent from repository -->
42
+ </parent>
43
+ {{/parentOverridden}}
44
+
45
+ <repositories>
46
+ <repository>
47
+ <id>repository.spring.milestone</id>
48
+ <name>Spring Milestone Repository</name>
49
+ <url>https://repo.spring.io/milestone</url>
50
+ </repository>
51
+ </repositories>
52
+ <pluginRepositories>
53
+ <pluginRepository>
54
+ <id>spring-milestones</id>
55
+ <url>https://repo.spring.io/milestone</url>
56
+ </pluginRepository>
57
+ </pluginRepositories>
58
+
59
+ <build>
60
+ <sourceDirectory>src/main/java</sourceDirectory>
61
+ {{#interfaceOnly}}
62
+ <plugins>
63
+ <plugin>
64
+ <groupId>org.apache.maven.plugins</groupId>
65
+ <artifactId>maven-source-plugin</artifactId>
66
+ <executions>
67
+ <execution>
68
+ <id>attach-sources</id>
69
+ <goals>
70
+ <goal>jar</goal>
71
+ </goals>
72
+ </execution>
73
+ </executions>
74
+ </plugin>
75
+ </plugins>
76
+ {{/interfaceOnly}}
77
+ {{^interfaceOnly}}
78
+ <plugins>
79
+ <plugin>
80
+ <groupId>org.springframework.boot</groupId>
81
+ <artifactId>spring-boot-maven-plugin</artifactId>
82
+ {{#classifier}}
83
+ <configuration>
84
+ <classifier>{{{classifier}}}</classifier>
85
+ </configuration>
86
+ {{/classifier}}
87
+ </plugin>
88
+ {{#apiFirst}}
89
+ <plugin>
90
+ <groupId>org.openapitools</groupId>
91
+ <artifactId>openapi-generator-maven-plugin</artifactId>
92
+ <version>{{{generatorVersion}}}</version>
93
+ <executions>
94
+ <execution>
95
+ <goals>
96
+ <goal>generate</goal>
97
+ </goals>
98
+ <configuration>
99
+ <inputSpec>src/main/resources/openapi.yaml</inputSpec>
100
+ <generatorName>spring</generatorName>
101
+ <apiPackage>{{{apiPackage}}}</apiPackage>
102
+ <modelPackage>{{{modelPackage}}}</modelPackage>
103
+ <generateSupportingFiles>false</generateSupportingFiles>
104
+ {{#modelNamePrefix}}
105
+ <modelNamePrefix>{{{.}}}</modelNamePrefix>
106
+ {{/modelNamePrefix}}
107
+ {{#modelNameSuffix}}
108
+ <modelNameSuffix>{{{.}}}</modelNameSuffix>
109
+ {{/modelNameSuffix}}
110
+ <configOptions>
111
+ {{#configOptions}}
112
+ <{{left}}>{{right}}</{{left}}>
113
+ {{/configOptions}}
114
+ </configOptions>
115
+ </configuration>
116
+ </execution>
117
+ </executions>
118
+ </plugin>
119
+ {{/apiFirst}}
120
+ </plugins>
121
+ {{/interfaceOnly}}
122
+ </build>
123
+ <dependencies>
124
+ <dependency>
125
+ <groupId>org.springframework.boot</groupId>
126
+ <artifactId>spring-boot-starter-web{{#reactive}}flux{{/reactive}}</artifactId>
127
+ </dependency>
128
+ <dependency>
129
+ <groupId>org.springframework.data</groupId>
130
+ <artifactId>spring-data-commons</artifactId>
131
+ </dependency>
132
+ {{#springDocDocumentationProvider}}
133
+ <!--SpringDoc dependencies -->
134
+ {{#useSwaggerUI}}
135
+ <dependency>
136
+ <groupId>org.springdoc</groupId>
137
+ <artifactId>springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui</artifactId>
138
+ <version>${springdoc.version}</version>
139
+ </dependency>
140
+ {{/useSwaggerUI}}
141
+ {{^useSwaggerUI}}
142
+ <dependency>
143
+ <groupId>org.springdoc</groupId>
144
+ <artifactId>springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-api</artifactId>
145
+ <version>${springdoc.version}</version>
146
+ </dependency>
147
+ {{/useSwaggerUI}}
148
+ {{/springDocDocumentationProvider}}
149
+ {{#useSwaggerUI}}
150
+ {{^springDocDocumentationProvider}}
151
+ <dependency>
152
+ <groupId>org.webjars</groupId>
153
+ <artifactId>swagger-ui</artifactId>
154
+ <version>${swagger-ui.version}</version>
155
+ </dependency>
156
+ <dependency>
157
+ <groupId>org.webjars</groupId>
158
+ <artifactId>webjars-locator-core</artifactId>
159
+ </dependency>
160
+ {{/springDocDocumentationProvider}}
161
+ {{/useSwaggerUI}}
162
+ {{^springDocDocumentationProvider}}
163
+ {{#swagger2AnnotationLibrary}}
164
+ <dependency>
165
+ <groupId>io.swagger.core.v3</groupId>
166
+ <artifactId>swagger-annotations</artifactId>
167
+ <version>${swagger-annotations.version}</version>
168
+ </dependency>
169
+ {{/swagger2AnnotationLibrary}}
170
+ {{/springDocDocumentationProvider}}
171
+ <!-- @Nullable annotation -->
172
+ <dependency>
173
+ <groupId>com.google.code.findbugs</groupId>
174
+ <artifactId>jsr305</artifactId>
175
+ <version>3.0.2</version>
176
+ </dependency>
177
+ <dependency>
178
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
179
+ <artifactId>jackson-dataformat-yaml</artifactId>
180
+ </dependency>
181
+ {{#withXml}}
182
+ <!-- XML processing: Jackson -->
183
+ <dependency>
184
+ <groupId>jakarta.xml.bind</groupId>
185
+ <artifactId>jakarta.xml.bind-api</artifactId>
186
+ </dependency>
187
+ <dependency>
188
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
189
+ <artifactId>jackson-dataformat-xml</artifactId>
190
+ </dependency>
191
+ {{/withXml}}
192
+ <dependency>
193
+ <groupId>com.fasterxml.jackson.datatype</groupId>
194
+ <artifactId>jackson-datatype-jsr310</artifactId>
195
+ </dependency>
196
+ {{#joda}}
197
+ <dependency>
198
+ <groupId>com.fasterxml.jackson.datatype</groupId>
199
+ <artifactId>jackson-datatype-joda</artifactId>
200
+ </dependency>
201
+ {{/joda}}
202
+ {{#openApiNullable}}
203
+ <dependency>
204
+ <groupId>org.openapitools</groupId>
205
+ <artifactId>jackson-databind-nullable</artifactId>
206
+ <version>0.2.6</version>
207
+ </dependency>
208
+ {{/openApiNullable}}
209
+ {{#useBeanValidation}}
210
+ <!-- Bean Validation API support -->
211
+ <dependency>
212
+ <groupId>org.springframework.boot</groupId>
213
+ <artifactId>spring-boot-starter-validation</artifactId>
214
+ </dependency>
215
+ {{/useBeanValidation}}
216
+ {{#virtualService}}
217
+ <!-- START Virtual Service API support -->
218
+ <dependency>
219
+ <groupId>io.virtualan</groupId>
220
+ <artifactId>virtualan-plugin</artifactId>
221
+ <version>${virtualan.version}</version>
222
+ </dependency>
223
+ <!-- HyperSQL DB -->
224
+ <dependency>
225
+ <groupId>org.hsqldb</groupId>
226
+ <artifactId>hsqldb</artifactId>
227
+ </dependency>
228
+ <!-- END Virtual Service API support -->
229
+ {{/virtualService}}
230
+ {{#hateoas}}
231
+ <!-- Spring HATEOAS -->
232
+ <dependency>
233
+ <groupId>org.springframework.boot</groupId>
234
+ <artifactId>spring-boot-starter-hateoas</artifactId>
235
+ </dependency>
236
+ {{/hateoas}}
237
+ <dependency>
238
+ <groupId>com.fasterxml.jackson.core</groupId>
239
+ <artifactId>jackson-databind</artifactId>
240
+ </dependency>
241
+ <dependency>
242
+ <groupId>org.springframework.boot</groupId>
243
+ <artifactId>spring-boot-starter-test</artifactId>
244
+ <scope>test</scope>
245
+ </dependency>
246
+ </dependencies>
247
+ </project>
@@ -0,0 +1,257 @@
1
+ {{! attach sources }}
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>{{groupId}}</groupId>
5
+ <artifactId>{{artifactId}}</artifactId>
6
+ <packaging>jar</packaging>
7
+ <name>{{artifactId}}</name>
8
+ <version>{{artifactVersion}}</version>
9
+ <properties>
10
+ <java.version>1.8</java.version>
11
+ <maven.compiler.source>${java.version}</maven.compiler.source>
12
+ <maven.compiler.target>${java.version}</maven.compiler.target>
13
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14
+ {{#springFoxDocumentationProvider}}
15
+ <springfox.version>2.9.2</springfox.version>
16
+ {{/springFoxDocumentationProvider}}
17
+ {{#springDocDocumentationProvider}}
18
+ <springdoc.version>1.6.14</springdoc.version>
19
+ {{/springDocDocumentationProvider}}
20
+ {{^springFoxDocumentationProvider}}
21
+ {{^springDocDocumentationProvider}}
22
+ {{#swagger1AnnotationLibrary}}
23
+ <swagger-annotations.version>1.6.6</swagger-annotations.version>
24
+ {{/swagger1AnnotationLibrary}}
25
+ {{#swagger2AnnotationLibrary}}
26
+ <swagger-annotations.version>2.2.7</swagger-annotations.version>
27
+ {{/swagger2AnnotationLibrary}}
28
+ {{/springDocDocumentationProvider}}
29
+ {{/springFoxDocumentationProvider}}
30
+ {{#virtualService}}
31
+ <virtualan.version>2.5.2</virtualan.version>
32
+ {{/virtualService}}
33
+ {{#useSwaggerUI}}
34
+ <swagger-ui.version>4.15.5</swagger-ui.version>
35
+ {{/useSwaggerUI}}
36
+ </properties>
37
+ {{#parentOverridden}}
38
+ <parent>
39
+ <groupId>{{{parentGroupId}}}</groupId>
40
+ <artifactId>{{{parentArtifactId}}}</artifactId>
41
+ <version>{{{parentVersion}}}</version>
42
+ </parent>
43
+ {{/parentOverridden}}
44
+ {{^parentOverridden}}
45
+ <parent>
46
+ <groupId>org.springframework.boot</groupId>
47
+ <artifactId>spring-boot-starter-parent</artifactId>
48
+ <version>{{#springFoxDocumentationProvider}}2.5.14{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.7.6{{/springFoxDocumentationProvider}}</version>
49
+ <relativePath/> <!-- lookup parent from repository -->
50
+ </parent>
51
+ {{/parentOverridden}}
52
+ <build>
53
+ <sourceDirectory>src/main/java</sourceDirectory>
54
+ {{#interfaceOnly}}
55
+ <plugins>
56
+ <plugin>
57
+ <groupId>org.apache.maven.plugins</groupId>
58
+ <artifactId>maven-source-plugin</artifactId>
59
+ <executions>
60
+ <execution>
61
+ <id>attach-sources</id>
62
+ <goals>
63
+ <goal>jar</goal>
64
+ </goals>
65
+ </execution>
66
+ </executions>
67
+ </plugin>
68
+ </plugins>
69
+ {{/interfaceOnly}}
70
+ {{^interfaceOnly}}
71
+ <plugins>
72
+ <plugin>
73
+ <groupId>org.springframework.boot</groupId>
74
+ <artifactId>spring-boot-maven-plugin</artifactId>
75
+ {{#classifier}}
76
+ <configuration>
77
+ <classifier>{{{classifier}}}</classifier>
78
+ </configuration>
79
+ {{/classifier}}
80
+ </plugin>
81
+ {{#apiFirst}}
82
+ <plugin>
83
+ <groupId>org.openapitools</groupId>
84
+ <artifactId>openapi-generator-maven-plugin</artifactId>
85
+ <version>{{{generatorVersion}}}</version>
86
+ <executions>
87
+ <execution>
88
+ <goals>
89
+ <goal>generate</goal>
90
+ </goals>
91
+ <configuration>
92
+ <inputSpec>src/main/resources/openapi.yaml</inputSpec>
93
+ <generatorName>spring</generatorName>
94
+ <apiPackage>{{{apiPackage}}}</apiPackage>
95
+ <modelPackage>{{{modelPackage}}}</modelPackage>
96
+ <generateSupportingFiles>false</generateSupportingFiles>
97
+ {{#modelNamePrefix}}
98
+ <modelNamePrefix>{{{.}}}</modelNamePrefix>
99
+ {{/modelNamePrefix}}
100
+ {{#modelNameSuffix}}
101
+ <modelNameSuffix>{{{.}}}</modelNameSuffix>
102
+ {{/modelNameSuffix}}
103
+ <configOptions>
104
+ {{#configOptions}}
105
+ <{{left}}>{{right}}</{{left}}>
106
+ {{/configOptions}}
107
+ </configOptions>
108
+ </configuration>
109
+ </execution>
110
+ </executions>
111
+ </plugin>
112
+ {{/apiFirst}}
113
+ </plugins>
114
+ {{/interfaceOnly}}
115
+ </build>
116
+ <dependencies>
117
+ <dependency>
118
+ <groupId>org.springframework.boot</groupId>
119
+ <artifactId>spring-boot-starter-web{{#reactive}}flux{{/reactive}}</artifactId>
120
+ </dependency>
121
+ <dependency>
122
+ <groupId>org.springframework.data</groupId>
123
+ <artifactId>spring-data-commons</artifactId>
124
+ </dependency>
125
+ {{#springDocDocumentationProvider}}
126
+ <!--SpringDoc dependencies -->
127
+ {{#useSwaggerUI}}
128
+ <dependency>
129
+ <groupId>org.springdoc</groupId>
130
+ <artifactId>springdoc-openapi-{{#reactive}}webflux-{{/reactive}}ui</artifactId>
131
+ <version>${springdoc.version}</version>
132
+ </dependency>
133
+ {{/useSwaggerUI}}
134
+ {{^useSwaggerUI}}
135
+ <dependency>
136
+ <groupId>org.springdoc</groupId>
137
+ <artifactId>springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core</artifactId>
138
+ <version>${springdoc.version}</version>
139
+ </dependency>
140
+ {{/useSwaggerUI}}
141
+ {{/springDocDocumentationProvider}}
142
+ {{#springFoxDocumentationProvider}}
143
+ <!--SpringFox dependencies -->
144
+ <dependency>
145
+ <groupId>io.springfox</groupId>
146
+ <artifactId>springfox-swagger2</artifactId>
147
+ <version>${springfox.version}</version>
148
+ </dependency>
149
+ {{/springFoxDocumentationProvider}}
150
+ {{#useSwaggerUI}}
151
+ {{^springDocDocumentationProvider}}
152
+ <dependency>
153
+ <groupId>org.webjars</groupId>
154
+ <artifactId>swagger-ui</artifactId>
155
+ <version>${swagger-ui.version}</version>
156
+ </dependency>
157
+ <dependency>
158
+ <groupId>org.webjars</groupId>
159
+ <artifactId>webjars-locator-core</artifactId>
160
+ </dependency>
161
+ {{/springDocDocumentationProvider}}
162
+ {{/useSwaggerUI}}
163
+ {{^springFoxDocumentationProvider}}
164
+ {{^springDocDocumentationProvider}}
165
+ {{#swagger1AnnotationLibrary}}
166
+ <dependency>
167
+ <groupId>io.swagger</groupId>
168
+ <artifactId>swagger-annotations</artifactId>
169
+ <version>${swagger-annotations.version}</version>
170
+ </dependency>
171
+ {{/swagger1AnnotationLibrary}}
172
+ {{#swagger2AnnotationLibrary}}
173
+ <dependency>
174
+ <groupId>io.swagger.core.v3</groupId>
175
+ <artifactId>swagger-annotations</artifactId>
176
+ <version>${swagger-annotations.version}</version>
177
+ </dependency>
178
+ {{/swagger2AnnotationLibrary}}
179
+ {{/springDocDocumentationProvider}}
180
+ {{/springFoxDocumentationProvider}}
181
+ <!-- @Nullable annotation -->
182
+ <dependency>
183
+ <groupId>com.google.code.findbugs</groupId>
184
+ <artifactId>jsr305</artifactId>
185
+ <version>3.0.2</version>
186
+ </dependency>
187
+ <dependency>
188
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
189
+ <artifactId>jackson-dataformat-yaml</artifactId>
190
+ </dependency>
191
+ {{#withXml}}
192
+ <!-- XML processing: Jackson -->
193
+ <dependency>
194
+ <groupId>jakarta.xml.bind</groupId>
195
+ <artifactId>jakarta.xml.bind-api</artifactId>
196
+ </dependency>
197
+ <dependency>
198
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
199
+ <artifactId>jackson-dataformat-xml</artifactId>
200
+ </dependency>
201
+ {{/withXml}}
202
+ <dependency>
203
+ <groupId>com.fasterxml.jackson.datatype</groupId>
204
+ <artifactId>jackson-datatype-jsr310</artifactId>
205
+ </dependency>
206
+ {{#joda}}
207
+ <dependency>
208
+ <groupId>com.fasterxml.jackson.datatype</groupId>
209
+ <artifactId>jackson-datatype-joda</artifactId>
210
+ </dependency>
211
+ {{/joda}}
212
+ {{#openApiNullable}}
213
+ <dependency>
214
+ <groupId>org.openapitools</groupId>
215
+ <artifactId>jackson-databind-nullable</artifactId>
216
+ <version>0.2.6</version>
217
+ </dependency>
218
+ {{/openApiNullable}}
219
+ {{#useBeanValidation}}
220
+ <!-- Bean Validation API support -->
221
+ <dependency>
222
+ <groupId>org.springframework.boot</groupId>
223
+ <artifactId>spring-boot-starter-validation</artifactId>
224
+ </dependency>
225
+ {{/useBeanValidation}}
226
+ {{#virtualService}}
227
+ <!-- START Virtual Service API support -->
228
+ <dependency>
229
+ <groupId>io.virtualan</groupId>
230
+ <artifactId>virtualan-plugin</artifactId>
231
+ <version>${virtualan.version}</version>
232
+ </dependency>
233
+ <!-- HyperSQL DB -->
234
+ <dependency>
235
+ <groupId>org.hsqldb</groupId>
236
+ <artifactId>hsqldb</artifactId>
237
+ </dependency>
238
+ <!-- END Virtual Service API support -->
239
+ {{/virtualService}}
240
+ {{#hateoas}}
241
+ <!-- Spring HATEOAS -->
242
+ <dependency>
243
+ <groupId>org.springframework.boot</groupId>
244
+ <artifactId>spring-boot-starter-hateoas</artifactId>
245
+ </dependency>
246
+ {{/hateoas}}
247
+ <dependency>
248
+ <groupId>com.fasterxml.jackson.core</groupId>
249
+ <artifactId>jackson-databind</artifactId>
250
+ </dependency>
251
+ <dependency>
252
+ <groupId>org.springframework.boot</groupId>
253
+ <artifactId>spring-boot-starter-test</artifactId>
254
+ <scope>test</scope>
255
+ </dependency>
256
+ </dependencies>
257
+ </project>
@@ -18,9 +18,9 @@
18
18
  "java.time.OffsetDateTime": "java.time.Instant",
19
19
  "org.springframework.core.io.Resource": "org.springframework.web.multipart.MultipartFile"
20
20
  },
21
- "inlineSchemaNameDefaults": {
22
- "arrayItemSuffix": "",
23
- "mapItemSuffix": "",
21
+ "inlineSchemaOptions": {
22
+ "ARRAY_ITEM_SUFFIX": "",
23
+ "MAP_ITEM_SUFFIX": "",
24
24
  "SKIP_SCHEMA_REUSE": "true"
25
25
  }
26
26
  }
@@ -1,4 +1,3 @@
1
- {{! optionally removes spring boot plugin if interfaceOnly flag is set }}
2
1
  {{! attach sources }}
3
2
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
3
  <modelVersion>4.0.0</modelVersion>
@@ -1,4 +1,3 @@
1
- {{! optionally removes spring boot plugin if interfaceOnly flag is set }}
2
1
  {{! attach sources }}
3
2
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
3
  <modelVersion>4.0.0</modelVersion>
@@ -1,5 +0,0 @@
1
- {{! generate required nullable properties as optional }}
2
- {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}
3
- @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}
4
- @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}
5
- @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}}
@@ -1,108 +0,0 @@
1
- {{! fix left in @RequestMapping }}
2
- /**
3
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
4
- * https://openapi-generator.tech
5
- * Do not edit the class manually.
6
- */
7
- package {{package}}
8
-
9
- {{#imports}}import {{import}}
10
- {{/imports}}
11
- {{#swagger2AnnotationLibrary}}
12
- import io.swagger.v3.oas.annotations.*
13
- import io.swagger.v3.oas.annotations.enums.*
14
- import io.swagger.v3.oas.annotations.media.*
15
- import io.swagger.v3.oas.annotations.responses.*
16
- import io.swagger.v3.oas.annotations.security.*
17
- {{/swagger2AnnotationLibrary}}
18
- {{#swagger1AnnotationLibrary}}
19
- import io.swagger.annotations.Api
20
- import io.swagger.annotations.ApiOperation
21
- import io.swagger.annotations.ApiParam
22
- import io.swagger.annotations.ApiResponse
23
- import io.swagger.annotations.ApiResponses
24
- import io.swagger.annotations.Authorization
25
- import io.swagger.annotations.AuthorizationScope
26
- {{/swagger1AnnotationLibrary}}
27
- import org.springframework.http.HttpStatus
28
- import org.springframework.http.MediaType
29
- import org.springframework.http.ResponseEntity
30
-
31
- import org.springframework.web.bind.annotation.*
32
- {{#useBeanValidation}}
33
- import org.springframework.validation.annotation.Validated
34
- {{/useBeanValidation}}
35
- import org.springframework.web.context.request.NativeWebRequest
36
- import org.springframework.beans.factory.annotation.Autowired
37
-
38
- {{#useBeanValidation}}
39
- import {{javaxPackage}}.validation.constraints.DecimalMax
40
- import {{javaxPackage}}.validation.constraints.DecimalMin
41
- import {{javaxPackage}}.validation.constraints.Email
42
- import {{javaxPackage}}.validation.constraints.Max
43
- import {{javaxPackage}}.validation.constraints.Min
44
- import {{javaxPackage}}.validation.constraints.NotNull
45
- import {{javaxPackage}}.validation.constraints.Pattern
46
- import {{javaxPackage}}.validation.constraints.Size
47
- import {{javaxPackage}}.validation.Valid
48
- {{/useBeanValidation}}
49
-
50
- {{#reactive}}
51
- import kotlinx.coroutines.flow.Flow
52
- {{/reactive}}
53
- import kotlin.collections.List
54
- import kotlin.collections.Map
55
-
56
- {{#useBeanValidation}}
57
- @Validated
58
- {{/useBeanValidation}}
59
- {{#swagger1AnnotationLibrary}}
60
- @Api(value = "{{{baseName}}}", description = "The {{{baseName}}} API")
61
- {{/swagger1AnnotationLibrary}}
62
-
63
- {{#operations}}
64
- interface {{classname}} {
65
- {{#isDelegate}}
66
-
67
- fun getDelegate(): {{classname}}Delegate = object: {{classname}}Delegate {}
68
- {{/isDelegate}}
69
- {{#operation}}
70
-
71
- {{#swagger2AnnotationLibrary}}
72
- @Operation(
73
- summary = "{{{summary}}}",
74
- operationId = "{{{operationId}}}",
75
- description = """{{{unescapedNotes}}}""",
76
- responses = [{{#responses}}
77
- ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = [Content(schema = Schema(implementation = {{{baseType}}}::class))]{{/baseType}}){{^-last}},{{/-last}}{{/responses}}
78
- ]{{#hasAuthMethods}},
79
- security = [ {{#authMethods}}SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes = [ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} ]{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} ]{{/hasAuthMethods}}
80
- ){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}
81
- @ApiOperation(
82
- value = "{{{summary}}}",
83
- nickname = "{{{operationId}}}",
84
- notes = "{{{notes}}}"{{#returnBaseType}},
85
- response = {{{.}}}::class{{/returnBaseType}}{{#returnContainer}},
86
- responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}},
87
- authorizations = [{{#authMethods}}Authorization(value = "{{name}}"{{#isOAuth}}, scopes = [{{#scopes}}AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}}]{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}}]{{/hasAuthMethods}})
88
- @ApiResponses(
89
- value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}}
90
- @RequestMapping(
91
- method = [RequestMethod.{{httpMethod}}],
92
- value = ["{{#lambda.escapeDoubleQuote}}{{path}}{{/lambda.escapeDoubleQuote}}"]{{#singleContentTypes}}{{#hasProduces}},
93
- produces = "{{{vendorExtensions.x-accepts}}}"{{/hasProduces}}{{#hasConsumes}},
94
- consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}},
95
- produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}},
96
- consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}}
97
- )
98
- {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultInterface}} {
99
- {{^isDelegate}}
100
- return {{>returnValue}}
101
- {{/isDelegate}}
102
- {{#isDelegate}}
103
- return getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
104
- {{/isDelegate}}
105
- }{{/skipDefaultInterface}}
106
- {{/operation}}
107
- }
108
- {{/operations}}
@@ -1,5 +0,0 @@
1
- {{! generate required nullable properties as optional }}
2
- {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}
3
- @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}
4
- @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}
5
- @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}}