@team-supercharge/oasg 13.0.0-test-export-01191261.0 → 13.1.0-kmp-8a9ad834.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.
- package/README.md +47 -12
- package/bin/oasg +15 -17
- package/config.schema.yml +29 -3
- package/package.json +2 -2
- package/targets/android/generate.sh +2 -2
- package/targets/android/generator-config.json +6 -1
- package/targets/android/templates/build.gradle.mustache +54 -21
- package/targets/android/templates/libraries/jvm-retrofit2/api.mustache +2 -10
- package/targets/android/templates/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +354 -0
- package/targets/common.sh +0 -8
- package/targets/feign/generator-config.json +4 -3
- package/targets/feign/templates/beanValidation.mustache +2 -7
- package/targets/feign/templates/formParams.mustache +2 -1
- package/targets/feign/templates/libraries/spring-cloud/clientConfiguration.mustache +118 -0
- package/targets/feign/templates/libraries/spring-cloud/pom-sb3.mustache +16 -16
- package/targets/feign/templates/libraries/spring-cloud/pom.mustache +16 -16
- package/targets/feign-kotlin/generator-config.json +3 -3
- package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb3.mustache +2 -1
- package/targets/flutter/generate.sh +0 -5
- package/targets/kmp/generate.sh +21 -0
- package/targets/kmp/generator-config.json +12 -0
- package/targets/kmp/publish.sh +11 -0
- package/targets/kmp/templates/build.gradle.kts.mustache +121 -0
- package/targets/kmp/templates/libraries/multiplatform/api.mustache +136 -0
- package/targets/nestjs/generate.sh +1 -0
- package/targets/nestjs/generator-config.json +5 -0
- package/targets/nestjs/templates/api.service.mustache +1 -1
- package/targets/nestjs/templates/reorder-operations.js +1 -1
- package/targets/nestjs/templates/rewrite-path-parameters.js +2 -2
- package/targets/react/generator-config.json +14 -0
- package/targets/spring/generator-config.json +4 -4
- package/targets/spring/templates/libraries/spring-boot/pom-sb3.mustache +247 -0
- package/targets/spring/templates/libraries/spring-boot/pom.mustache +257 -0
- package/targets/spring-kotlin/generator-config.json +3 -3
- package/targets/spring-kotlin/templates/libraries/spring-boot/pom-sb3.mustache +0 -1
- package/targets/spring-kotlin/templates/libraries/spring-boot/pom.mustache +0 -1
- package/targets/.env +0 -3
- package/targets/feign-kotlin/templates/apiInterface.mustache +0 -108
- package/targets/feign-kotlin/templates/dataClassReqVar.mustache +0 -5
- package/targets/react-native/generator-config.json +0 -7
- package/targets/spring-kotlin/templates/dataClassReqVar.mustache +0 -5
- /package/targets/{react-native → react}/generate.sh +0 -0
- /package/targets/{react-native → react}/publish.sh +0 -0
package/README.md
CHANGED
@@ -393,7 +393,7 @@ Glob patterns are supported.
|
|
393
393
|
|
394
394
|
### Overrides
|
395
395
|
|
396
|
-
The following sections can be
|
396
|
+
The following sections can be overridden: `info`, `externalDocs`, `license` and `contact`.
|
397
397
|
|
398
398
|
It does not override but replace the values of the OpenApi Specification with the corresponding values of the `config.json`.
|
399
399
|
|
@@ -402,20 +402,20 @@ You can check [here](https://gitlab.supercharge.io/misc/oasg/-/blob/master/confi
|
|
402
402
|
```json
|
403
403
|
"overrides": {
|
404
404
|
"info": {
|
405
|
-
"title": "
|
406
|
-
"description": "
|
407
|
-
"termsOfService": "
|
405
|
+
"title": "Overridden Frontend API",
|
406
|
+
"description": "Overridden Frontend Merged API Description",
|
407
|
+
"termsOfService": "Overridden Terms Of Service",
|
408
408
|
"version": "1.0.2"
|
409
409
|
},
|
410
410
|
"externalDocs": {
|
411
|
-
"description": "
|
411
|
+
"description": "Overridden externalDocs",
|
412
412
|
"url": "https://supercharge.io"
|
413
413
|
},
|
414
414
|
"license": {
|
415
|
-
"name": "
|
415
|
+
"name": "Overridden License"
|
416
416
|
},
|
417
417
|
"contact": {
|
418
|
-
"name": "
|
418
|
+
"name": "Overridden Contact",
|
419
419
|
"url": "https://supercharge.io",
|
420
420
|
"email": "hello@supercharge.io"
|
421
421
|
}
|
@@ -454,12 +454,12 @@ Common target parameters
|
|
454
454
|
| packageName | Name of the generated NPM package | Y | - |
|
455
455
|
| repository | URL of the NPM package registry | Y | - |
|
456
456
|
|
457
|
-
#### `react
|
457
|
+
#### `react`
|
458
458
|
|
459
459
|
```json
|
460
460
|
{
|
461
|
-
"id": "client-react
|
462
|
-
"type": "react
|
461
|
+
"id": "client-react",
|
462
|
+
"type": "react",
|
463
463
|
"source": "source-merged",
|
464
464
|
"packageName": "@project/oasg-example-react-native",
|
465
465
|
"repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/npm/"
|
@@ -637,6 +637,33 @@ TBD
|
|
637
637
|
| repository | URL of the generated client api code repository | Y | - |
|
638
638
|
| generatorCustomArgs | Custom arguments of the generator | N | - |
|
639
639
|
|
640
|
+
#### `kmp`
|
641
|
+
|
642
|
+
```json
|
643
|
+
{
|
644
|
+
"id": "client-kmp",
|
645
|
+
"type": "kmp",
|
646
|
+
"source": "source-merged",
|
647
|
+
"packageName": "io.supercharge.oasg.example",
|
648
|
+
"groupId": "io.supercharge.oasg.example",
|
649
|
+
"artifactId": "client",
|
650
|
+
"generatorCustomArgs": "--model-name-suffix=ApiModel",
|
651
|
+
"formatter": "1.0.0",
|
652
|
+
"formatterCustomArgs": "--disabled_rules=no-wildcard-imports,max-line-length,enum-entry-name-case",
|
653
|
+
"repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/maven"
|
654
|
+
}
|
655
|
+
```
|
656
|
+
|
657
|
+
|Parameter| Description| Required | Default |
|
658
|
+
|-|-|-|-|
|
659
|
+
| packageName | Kotlin package name of the generated client | Y | - |
|
660
|
+
| groupId | Generated artifact package's organization | Y | - |
|
661
|
+
| artifactId | Generated artifact id | Y | - |
|
662
|
+
| generatorCustomArgs | Custom arguments of the generator | N | - |
|
663
|
+
| formatter | `ktlint`: it can be a released version or a http(s) url | N | 1.0.0 |
|
664
|
+
| formatterCustomArgs | Custom arguments of the `ktlint` formatter | N | --disabled_rules=no-wildcard-imports,max-line-length,enum-entry-name-case |
|
665
|
+
| repository | URL of the Maven Repository | N | - |
|
666
|
+
|
640
667
|
#### `python`
|
641
668
|
|
642
669
|
```json
|
@@ -777,9 +804,11 @@ describe('Auth', function () {
|
|
777
804
|
|
778
805
|
This section covers the breaking changes and their migrations across major version upgrades.
|
779
806
|
|
780
|
-
## From `12.x.x` to `13.0.
|
807
|
+
## From `12.x.x` to `13.0.1`
|
808
|
+
|
809
|
+
> ❗ Due to version `13.0.0` has been published before erroneously (then unpublished) to the NPM registry, this version of the artifact won't be available either as an NPM package or a Docker base image. Please use the `13.0.1` patch version instead.
|
781
810
|
|
782
|
-
### Schema naming updates in `angular`, `python`, `ios` targets
|
811
|
+
### Schema naming updates in `angular`, `python`, `android`,`ios`, `nestjs`, `react` targets
|
783
812
|
|
784
813
|
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:
|
785
814
|
|
@@ -795,6 +824,12 @@ and more:
|
|
795
824
|
|
796
825
|
* 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`
|
797
826
|
|
827
|
+
### Breaking in `react-native` target
|
828
|
+
|
829
|
+
* as both technologies used the same `typescript-fetch`-based generator, with this version the previous `react-native` target has been renamed to a more generic `react` name
|
830
|
+
- if at the future the best practices would change between the web-based _React_ and _React Native_ mobile projects, the `react-native` target will be reintroduced
|
831
|
+
* enum key with multiple segments will contain underscores e.g. the enum key generated from the `value_one` value was used to be `VALUEONE`, this will become `VALUE_ONE` after the update
|
832
|
+
|
798
833
|
## From `11.x.x` to `12.0.0`
|
799
834
|
|
800
835
|
The following options from the `openapi` target type has been moved to the [Source](#source) configuration.
|
package/bin/oasg
CHANGED
@@ -33,24 +33,25 @@ const PROXY_PORT = '9999';
|
|
33
33
|
|
34
34
|
const DEFAULT_GENERATOR_MAPPING = {
|
35
35
|
// client targets
|
36
|
-
"android": { version: '
|
37
|
-
"angular": { version: '7.0.
|
38
|
-
"feign": { version: '
|
39
|
-
"feign-kotlin": { version: '
|
40
|
-
"flutter": { version: '7.0.
|
36
|
+
"android": { version: '7.0.1', generator: 'kotlin' },
|
37
|
+
"angular": { version: '7.0.1', generator: 'typescript-angular' },
|
38
|
+
"feign": { version: '7.0.1', generator: 'spring' },
|
39
|
+
"feign-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
|
40
|
+
"flutter": { version: '7.0.1', generator: 'dart-dio' },
|
41
41
|
"ios": { version: '7.0.1', generator: 'swift5' },
|
42
|
-
"
|
43
|
-
"
|
42
|
+
"kmp": { version: 'https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.2.0-SNAPSHOT/openapi-generator-cli-7.2.0-20231208.144106-84.jar', generator: 'kotlin' },
|
43
|
+
"python": { version: '7.0.1', generator: 'python' },
|
44
|
+
"react": { version: '7.0.1', generator: 'typescript-fetch' },
|
44
45
|
// server targets
|
45
|
-
"nestjs": { version: '
|
46
|
-
"spring": { version: '
|
47
|
-
"spring-kotlin": { version: '
|
46
|
+
"nestjs": { version: '7.0.1', generator: 'typescript-angular' },
|
47
|
+
"spring": { version: '7.0.1', generator: 'spring' },
|
48
|
+
"spring-kotlin": { version: '7.0.1', generator: 'kotlin-spring' },
|
48
49
|
// misc targets
|
49
50
|
"contract-testing": { version: '4.3.1', generator: 'typescript-node' },
|
50
51
|
"openapi": { version: undefined, generator: undefined },
|
51
52
|
"stubby": { version: '4.3.1', generator: 'stubby' },
|
52
53
|
};
|
53
|
-
const DEFAULT_KTLINT_VERSION = '0.
|
54
|
+
const DEFAULT_KTLINT_VERSION = '1.0.0';
|
54
55
|
const BIN_FOLDER = 'out/.bin';
|
55
56
|
const TMP_FOLDER = 'out/.tmp';
|
56
57
|
|
@@ -108,9 +109,6 @@ async function run() {
|
|
108
109
|
|
109
110
|
// generate
|
110
111
|
.command(['generate [target]', 'g'], 'generate packages', (yargs) => {
|
111
|
-
console.log('----------------------------')
|
112
|
-
console.log(JSON.stringify(process.env))
|
113
|
-
console.log('----------------------------')
|
114
112
|
yargs
|
115
113
|
.positional('target', {
|
116
114
|
describe: 'specify a target (optional)',
|
@@ -250,10 +248,10 @@ async function parseConfig() {
|
|
250
248
|
}
|
251
249
|
})
|
252
250
|
|
253
|
-
// set default ktlint to android targets with undefined
|
251
|
+
// set default ktlint to android and KMP targets with undefined
|
254
252
|
config.targets.forEach(t => {
|
255
253
|
//TODO: handle different types of platform
|
256
|
-
if (t.type === 'android') {
|
254
|
+
if (t.type === 'android' || t.type === 'kmp') {
|
257
255
|
if (!t.formatter) {
|
258
256
|
t.formatter = DEFAULT_KTLINT_VERSION;
|
259
257
|
}
|
@@ -485,7 +483,7 @@ async function generate(argv) {
|
|
485
483
|
let formatter;
|
486
484
|
|
487
485
|
//TODO: handle different types of platforms
|
488
|
-
if (target.type === 'android') {
|
486
|
+
if (target.type === 'android' || target.type === 'kmp') {
|
489
487
|
formatter = fetchFormatter(target);
|
490
488
|
}
|
491
489
|
|
package/config.schema.yml
CHANGED
@@ -11,7 +11,7 @@ properties:
|
|
11
11
|
items:
|
12
12
|
oneOf:
|
13
13
|
- $ref: '#/targets/Angular'
|
14
|
-
- $ref: '#/targets/
|
14
|
+
- $ref: '#/targets/React'
|
15
15
|
- $ref: '#/targets/Feign'
|
16
16
|
- $ref: '#/targets/FeignKotlin'
|
17
17
|
- $ref: '#/targets/Spring'
|
@@ -24,6 +24,7 @@ properties:
|
|
24
24
|
- $ref: '#/targets/NestJS'
|
25
25
|
- $ref: '#/targets/OpenAPI'
|
26
26
|
- $ref: '#/targets/Flutter'
|
27
|
+
- $ref: '#/targets/Kmp'
|
27
28
|
required:
|
28
29
|
- targets
|
29
30
|
additionalProperties: false
|
@@ -121,12 +122,12 @@ targets:
|
|
121
122
|
- packageName
|
122
123
|
- repository
|
123
124
|
|
124
|
-
|
125
|
+
React:
|
125
126
|
allOf:
|
126
127
|
- $ref: '#/targets/Base'
|
127
128
|
- properties:
|
128
129
|
type:
|
129
|
-
pattern: "^react
|
130
|
+
pattern: "^react$"
|
130
131
|
packageName:
|
131
132
|
type: string
|
132
133
|
repository:
|
@@ -346,6 +347,31 @@ targets:
|
|
346
347
|
- packageName
|
347
348
|
- repository
|
348
349
|
|
350
|
+
Kmp:
|
351
|
+
allOf:
|
352
|
+
- $ref: '#/targets/Base'
|
353
|
+
- properties:
|
354
|
+
type:
|
355
|
+
pattern: "^kmp$"
|
356
|
+
packageName:
|
357
|
+
type: string
|
358
|
+
groupId:
|
359
|
+
type: string
|
360
|
+
artifactId:
|
361
|
+
type: string
|
362
|
+
formatter:
|
363
|
+
type: string
|
364
|
+
pattern: '^(\d+\.\d+\.\d+(-.+)?)|(^http(s)?:\/\/.+$)$' # matches: 0.0.0(-pre) and http(s)://XXX
|
365
|
+
formatterCustomArgs:
|
366
|
+
type: string
|
367
|
+
repository:
|
368
|
+
type: string
|
369
|
+
required:
|
370
|
+
- packageName
|
371
|
+
- groupId
|
372
|
+
- artifactId
|
373
|
+
- repository
|
374
|
+
|
349
375
|
definitions:
|
350
376
|
# default
|
351
377
|
SourceOverrides:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@team-supercharge/oasg",
|
3
|
-
"version": "13.
|
3
|
+
"version": "13.1.0-kmp-8a9ad834.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",
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"dependencies": {
|
29
29
|
"@apidevtools/json-schema-ref-parser": "^10.1.0",
|
30
30
|
"@apidevtools/swagger-parser": "^10.1.0",
|
31
|
-
"@redocly/cli": "1.
|
31
|
+
"@redocly/cli": "1.2.0",
|
32
32
|
"@stoplight/prism-cli": "4.14.1",
|
33
33
|
"@stoplight/spectral-cli": "6.6.0",
|
34
34
|
"ajv": "^8.12.0",
|
@@ -7,7 +7,7 @@ mkdir -p out/$targetId
|
|
7
7
|
|
8
8
|
if [ -z "$formatterCustomArgs" ]
|
9
9
|
then
|
10
|
-
formatterCustomArgs="--disabled_rules=no-wildcard-imports,max-line-length"
|
10
|
+
formatterCustomArgs="--disabled_rules=no-wildcard-imports,max-line-length,enum-entry-name-case"
|
11
11
|
fi
|
12
12
|
|
13
13
|
java -jar $binary generate \
|
@@ -18,4 +18,4 @@ java -jar $binary generate \
|
|
18
18
|
-c $(dirname "$0")/generator-config.json \
|
19
19
|
-p "artifactId=${artifactId},groupId=${groupId},packageName=${packageName},artifactVersion=${version}" $generatorCustomArgs
|
20
20
|
|
21
|
-
$formatterBinary
|
21
|
+
$formatterBinary -F "out/$targetId/src/**/*.kt" $formatterCustomArgs
|
@@ -4,5 +4,10 @@
|
|
4
4
|
"dateLibrary": "java8-localdatetime",
|
5
5
|
"useCoroutines": true,
|
6
6
|
"moshiCodeGen": true,
|
7
|
-
"omitGradleWrapper":
|
7
|
+
"omitGradleWrapper": false,
|
8
|
+
"inlineSchemaOptions": {
|
9
|
+
"ARRAY_ITEM_SUFFIX": "",
|
10
|
+
"MAP_ITEM_SUFFIX": "",
|
11
|
+
"SKIP_SCHEMA_REUSE": "true"
|
12
|
+
}
|
8
13
|
}
|
@@ -9,7 +9,7 @@ wrapper {
|
|
9
9
|
{{/omitGradleWrapper}}
|
10
10
|
|
11
11
|
buildscript {
|
12
|
-
ext.kotlin_version = '1.
|
12
|
+
ext.kotlin_version = '1.8.10'
|
13
13
|
{{#jvm-ktor}}
|
14
14
|
ext.ktor_version = '2.1.3'
|
15
15
|
{{/jvm-ktor}}
|
@@ -28,6 +28,16 @@ buildscript {
|
|
28
28
|
{{#jvm-vertx}}
|
29
29
|
ext.vertx_version = "4.3.3"
|
30
30
|
{{/jvm-vertx}}
|
31
|
+
{{#jvm-spring-webclient}}
|
32
|
+
{{#useSpringBoot3}}
|
33
|
+
ext.spring_boot_version = "3.1.0"
|
34
|
+
{{/useSpringBoot3}}
|
35
|
+
{{^useSpringBoot3}}
|
36
|
+
ext.spring_boot_version = "2.7.12"
|
37
|
+
{{/useSpringBoot3}}
|
38
|
+
ext.reactor_version = "3.5.6"
|
39
|
+
{{/jvm-spring-webclient}}
|
40
|
+
ext.spotless_version = "6.13.0"
|
31
41
|
|
32
42
|
repositories {
|
33
43
|
maven { url "https://repo1.maven.org/maven2" }
|
@@ -37,6 +47,7 @@ buildscript {
|
|
37
47
|
{{#kotlinx_serialization}}
|
38
48
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
39
49
|
{{/kotlinx_serialization}}
|
50
|
+
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
|
40
51
|
}
|
41
52
|
}
|
42
53
|
|
@@ -54,6 +65,7 @@ apply plugin: 'kotlinx-serialization'
|
|
54
65
|
apply plugin: 'idea'
|
55
66
|
{{/idea}}
|
56
67
|
apply plugin: 'maven-publish'
|
68
|
+
apply plugin: 'com.diffplug.spotless'
|
57
69
|
{{^useSettingsGradle}}
|
58
70
|
|
59
71
|
repositories {
|
@@ -61,6 +73,27 @@ repositories {
|
|
61
73
|
}
|
62
74
|
{{/useSettingsGradle}}
|
63
75
|
|
76
|
+
// Use spotless plugin to automatically format code, remove unused import, etc
|
77
|
+
// To apply changes directly to the file, run `gradlew spotlessApply`
|
78
|
+
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
|
79
|
+
spotless {
|
80
|
+
// comment out below to run spotless as part of the `check` task
|
81
|
+
enforceCheck false
|
82
|
+
|
83
|
+
format 'misc', {
|
84
|
+
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
|
85
|
+
target '.gitignore'
|
86
|
+
|
87
|
+
// define the steps to apply to those files
|
88
|
+
trimTrailingWhitespace()
|
89
|
+
indentWithSpaces() // Takes an integer argument if you don't like 4
|
90
|
+
endWithNewline()
|
91
|
+
}
|
92
|
+
kotlin {
|
93
|
+
ktfmt()
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
64
97
|
test {
|
65
98
|
useJUnitPlatform()
|
66
99
|
}
|
@@ -73,7 +106,13 @@ idea {
|
|
73
106
|
}
|
74
107
|
}
|
75
108
|
{{/idea}}
|
76
|
-
|
109
|
+
{{#jvm-spring-webclient}}{{#useSpringBoot3}}
|
110
|
+
kotlin {
|
111
|
+
jvmToolchain {
|
112
|
+
languageVersion.set(JavaLanguageVersion.of(17))
|
113
|
+
}
|
114
|
+
}
|
115
|
+
{{/useSpringBoot3}}{{/jvm-spring-webclient}}
|
77
116
|
dependencies {
|
78
117
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
79
118
|
{{^doNotUseRxAndCoroutines}}
|
@@ -84,13 +123,13 @@ dependencies {
|
|
84
123
|
{{#moshi}}
|
85
124
|
{{^moshiCodeGen}}
|
86
125
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
87
|
-
implementation "com.squareup.moshi:moshi-kotlin:1.
|
88
|
-
implementation "com.squareup.moshi:moshi-adapters:1.
|
126
|
+
implementation "com.squareup.moshi:moshi-kotlin:1.14.0"
|
127
|
+
implementation "com.squareup.moshi:moshi-adapters:1.14.0"
|
89
128
|
{{/moshiCodeGen}}
|
90
129
|
{{#moshiCodeGen}}
|
91
|
-
implementation "com.squareup.moshi:moshi:1.
|
92
|
-
implementation "com.squareup.moshi:moshi-adapters:1.
|
93
|
-
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.
|
130
|
+
implementation "com.squareup.moshi:moshi:1.14.0"
|
131
|
+
implementation "com.squareup.moshi:moshi-adapters:1.14.0"
|
132
|
+
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.14.0"
|
94
133
|
{{/moshiCodeGen}}
|
95
134
|
{{/moshi}}
|
96
135
|
{{#gson}}
|
@@ -98,8 +137,8 @@ dependencies {
|
|
98
137
|
{{/gson}}
|
99
138
|
{{#jackson}}
|
100
139
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
101
|
-
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.
|
102
|
-
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.
|
140
|
+
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.14.3"
|
141
|
+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.3"
|
103
142
|
{{/jackson}}
|
104
143
|
{{#kotlinx_serialization}}
|
105
144
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
|
@@ -120,10 +159,14 @@ dependencies {
|
|
120
159
|
implementation "com.squareup.okhttp3:okhttp:3.12.13"
|
121
160
|
{{/jvm-okhttp3}}
|
122
161
|
{{#jvm-okhttp4}}
|
123
|
-
implementation "com.squareup.okhttp3:okhttp:4.
|
162
|
+
implementation "com.squareup.okhttp3:okhttp:4.11.0"
|
124
163
|
{{/jvm-okhttp4}}
|
164
|
+
{{#jvm-spring-webclient}}
|
165
|
+
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
|
166
|
+
implementation "io.projectreactor:reactor-core:$reactor_version"
|
167
|
+
{{/jvm-spring-webclient}}
|
125
168
|
{{#threetenbp}}
|
126
|
-
implementation "org.threeten:threetenbp:1.
|
169
|
+
implementation "org.threeten:threetenbp:1.6.8"
|
127
170
|
{{/threetenbp}}
|
128
171
|
{{#jvm-retrofit2}}
|
129
172
|
{{#hasOAuthMethods}}
|
@@ -175,15 +218,12 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
175
218
|
{{/kotlinx_serialization}}
|
176
219
|
|
177
220
|
// OASg added for publication
|
178
|
-
|
179
221
|
buildscript {
|
180
222
|
dependencies {
|
181
223
|
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.20'
|
182
224
|
}
|
183
225
|
}
|
184
|
-
|
185
226
|
apply plugin: 'org.jetbrains.dokka'
|
186
|
-
|
187
227
|
task dokkaJar(type: Jar) {
|
188
228
|
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
189
229
|
description = "Assembles Kotlin docs with Dokka"
|
@@ -191,38 +231,31 @@ task dokkaJar(type: Jar) {
|
|
191
231
|
from(dokkaHtml)
|
192
232
|
dependsOn(dokkaHtml)
|
193
233
|
}
|
194
|
-
|
195
234
|
task sourceJar(type: Jar) {
|
196
235
|
archiveClassifier.set('sources')
|
197
236
|
from sourceSets.main.allSource
|
198
237
|
from 'build/generated/source/kapt/main'
|
199
238
|
dependsOn project.tasks.getByName("compileKotlin")
|
200
239
|
}
|
201
|
-
|
202
240
|
publishing {
|
203
241
|
publications {
|
204
242
|
maven(MavenPublication) {
|
205
243
|
groupId = '{{packageName}}'
|
206
244
|
artifactId = '{{artifactId}}'
|
207
245
|
version = "{{artifactVersion}}"
|
208
|
-
|
209
246
|
artifact(dokkaJar)
|
210
247
|
artifact(sourceJar)
|
211
|
-
|
212
248
|
from components.java
|
213
249
|
}
|
214
250
|
}
|
215
|
-
|
216
251
|
repositories {
|
217
252
|
maven {
|
218
253
|
name = "Gitlab"
|
219
254
|
url = project.repoUrl
|
220
|
-
|
221
255
|
credentials(HttpHeaderCredentials) {
|
222
256
|
name = "Job-Token"
|
223
257
|
value = System.env.CI_JOB_TOKEN
|
224
258
|
}
|
225
|
-
|
226
259
|
authentication {
|
227
260
|
header(HttpHeaderAuthentication)
|
228
261
|
}
|
@@ -65,12 +65,6 @@ import okhttp3.MultipartBody
|
|
65
65
|
|
66
66
|
{{/isMultipart}}
|
67
67
|
{{/x-kotlin-multipart-import}}
|
68
|
-
{{#operation}}
|
69
|
-
{{#isResponseFile}}
|
70
|
-
import okhttp3.ResponseBody
|
71
|
-
|
72
|
-
{{/isResponseFile}}
|
73
|
-
{{/operation}}
|
74
68
|
interface {{classname}} {
|
75
69
|
{{#operation}}
|
76
70
|
{{#allParams}}
|
@@ -79,7 +73,7 @@ interface {{classname}} {
|
|
79
73
|
/**
|
80
74
|
* enum for parameter {{paramName}}
|
81
75
|
*/
|
82
|
-
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}
|
76
|
+
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
|
83
77
|
{{^enumUnknownDefaultCase}}
|
84
78
|
{{#allowableValues}}
|
85
79
|
{{#enumVars}}
|
@@ -151,9 +145,7 @@ interface {{classname}} {
|
|
151
145
|
{{^formParams}}
|
152
146
|
{{#prioritizedContentTypes}}
|
153
147
|
{{#-first}}
|
154
|
-
@Headers({
|
155
|
-
"Content-Type:{{{mediaType}}}"
|
156
|
-
})
|
148
|
+
@Headers("Content-Type:{{{mediaType}}}")
|
157
149
|
{{/-first}}
|
158
150
|
{{/prioritizedContentTypes}}
|
159
151
|
{{/formParams}}
|