@team-supercharge/oasg 10.0.1 → 10.0.2-android-remove-response-wrapper-52d65f77.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [10.0.2-android-remove-response-wrapper-52d65f77.0](https://gitlab.com/team-supercharge/oasg/compare/v10.0.1...v10.0.2-android-remove-response-wrapper-52d65f77.0) (2023-05-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **android:** remove Response wrapper from function return types ([52d65f7](https://gitlab.com/team-supercharge/oasg/commit/52d65f77ea28bf0d3c7fc1867c99425488171a0d))
|
|
11
|
+
|
|
5
12
|
### [10.0.1](https://gitlab.com/team-supercharge/oasg/compare/v10.0.0...v10.0.1) (2023-05-10)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-supercharge/oasg",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2-android-remove-response-wrapper-52d65f77.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",
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
package {{apiPackage}}
|
|
2
|
+
|
|
3
|
+
import {{packageName}}.infrastructure.CollectionFormats.*
|
|
4
|
+
import retrofit2.http.*
|
|
5
|
+
{{#doNotUseRxAndCoroutines}}
|
|
6
|
+
import retrofit2.Call
|
|
7
|
+
{{/doNotUseRxAndCoroutines}}
|
|
8
|
+
{{^doNotUseRxAndCoroutines}}
|
|
9
|
+
{{#useCoroutines}}
|
|
10
|
+
import retrofit2.Response
|
|
11
|
+
{{/useCoroutines}}
|
|
12
|
+
{{/doNotUseRxAndCoroutines}}
|
|
13
|
+
import okhttp3.RequestBody
|
|
14
|
+
{{#isResponseFile}}
|
|
15
|
+
import okhttp3.ResponseBody
|
|
16
|
+
{{/isResponseFile}}
|
|
17
|
+
{{#isMultipart}}
|
|
18
|
+
import okhttp3.MultipartBody
|
|
19
|
+
{{/isMultipart}}
|
|
20
|
+
{{^doNotUseRxAndCoroutines}}
|
|
21
|
+
{{#useRxJava}}
|
|
22
|
+
import rx.Observable
|
|
23
|
+
{{/useRxJava}}
|
|
24
|
+
{{#useRxJava2}}
|
|
25
|
+
import io.reactivex.Single
|
|
26
|
+
{{/useRxJava2}}
|
|
27
|
+
{{#useRxJava3}}
|
|
28
|
+
import io.reactivex.rxjava3.core.Single
|
|
29
|
+
{{/useRxJava3}}
|
|
30
|
+
{{^returnType}}
|
|
31
|
+
{{#useRxJava2}}
|
|
32
|
+
import io.reactivex.Completable
|
|
33
|
+
{{/useRxJava2}}
|
|
34
|
+
{{#useRxJava3}}
|
|
35
|
+
import io.reactivex.rxjava3.core.Completable
|
|
36
|
+
{{/useRxJava3}}
|
|
37
|
+
{{/returnType}}
|
|
38
|
+
{{/doNotUseRxAndCoroutines}}
|
|
39
|
+
{{^multiplatform}}
|
|
40
|
+
{{#gson}}
|
|
41
|
+
import com.google.gson.annotations.SerializedName
|
|
42
|
+
{{/gson}}
|
|
43
|
+
{{#moshi}}
|
|
44
|
+
import com.squareup.moshi.Json
|
|
45
|
+
{{/moshi}}
|
|
46
|
+
{{#jackson}}
|
|
47
|
+
import com.fasterxml.jackson.annotation.JsonProperty
|
|
48
|
+
{{/jackson}}
|
|
49
|
+
{{#kotlinx_serialization}}
|
|
50
|
+
import kotlinx.serialization.SerialName
|
|
51
|
+
import kotlinx.serialization.Serializable
|
|
52
|
+
{{/kotlinx_serialization}}
|
|
53
|
+
{{/multiplatform}}
|
|
54
|
+
{{#multiplatform}}
|
|
55
|
+
import kotlinx.serialization.*
|
|
56
|
+
{{/multiplatform}}
|
|
57
|
+
|
|
58
|
+
{{#imports}}import {{import}}
|
|
59
|
+
{{/imports}}
|
|
60
|
+
|
|
61
|
+
{{#operations}}
|
|
62
|
+
{{#x-kotlin-multipart-import}}
|
|
63
|
+
{{^isMultipart}}
|
|
64
|
+
import okhttp3.MultipartBody
|
|
65
|
+
|
|
66
|
+
{{/isMultipart}}
|
|
67
|
+
{{/x-kotlin-multipart-import}}
|
|
68
|
+
{{#operation}}
|
|
69
|
+
{{#isResponseFile}}
|
|
70
|
+
import okhttp3.ResponseBody
|
|
71
|
+
|
|
72
|
+
{{/isResponseFile}}
|
|
73
|
+
{{/operation}}
|
|
74
|
+
interface {{classname}} {
|
|
75
|
+
{{#operation}}
|
|
76
|
+
{{#allParams}}
|
|
77
|
+
{{#isEnum}}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* enum for parameter {{paramName}}
|
|
81
|
+
*/
|
|
82
|
+
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
|
|
83
|
+
{{^enumUnknownDefaultCase}}
|
|
84
|
+
{{#allowableValues}}
|
|
85
|
+
{{#enumVars}}
|
|
86
|
+
{{^multiplatform}}
|
|
87
|
+
{{#moshi}}
|
|
88
|
+
@Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}
|
|
89
|
+
{{/moshi}}
|
|
90
|
+
{{#gson}}
|
|
91
|
+
@SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}
|
|
92
|
+
{{/gson}}
|
|
93
|
+
{{#jackson}}
|
|
94
|
+
@JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}
|
|
95
|
+
{{/jackson}}
|
|
96
|
+
{{#kotlinx_serialization}}
|
|
97
|
+
@SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}
|
|
98
|
+
{{/kotlinx_serialization}}
|
|
99
|
+
{{/multiplatform}}
|
|
100
|
+
{{#multiplatform}}
|
|
101
|
+
@SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}
|
|
102
|
+
{{/multiplatform}}
|
|
103
|
+
{{/enumVars}}
|
|
104
|
+
{{/allowableValues}}
|
|
105
|
+
{{/enumUnknownDefaultCase}}
|
|
106
|
+
{{#enumUnknownDefaultCase}}
|
|
107
|
+
{{#allowableValues}}
|
|
108
|
+
{{#enumVars}}
|
|
109
|
+
{{^-last}}
|
|
110
|
+
{{^multiplatform}}
|
|
111
|
+
{{#moshi}}
|
|
112
|
+
@Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}),
|
|
113
|
+
{{/moshi}}
|
|
114
|
+
{{#gson}}
|
|
115
|
+
@SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}),
|
|
116
|
+
{{/gson}}
|
|
117
|
+
{{#jackson}}
|
|
118
|
+
@JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}),
|
|
119
|
+
{{/jackson}}
|
|
120
|
+
{{#kotlinx_serialization}}
|
|
121
|
+
@SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}),
|
|
122
|
+
{{/kotlinx_serialization}}
|
|
123
|
+
{{/multiplatform}}
|
|
124
|
+
{{#multiplatform}}
|
|
125
|
+
@SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}),
|
|
126
|
+
{{/multiplatform}}
|
|
127
|
+
{{/-last}}
|
|
128
|
+
{{/enumVars}}
|
|
129
|
+
{{/allowableValues}}
|
|
130
|
+
{{/enumUnknownDefaultCase}}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
{{/isEnum}}
|
|
134
|
+
{{/allParams}}
|
|
135
|
+
/**
|
|
136
|
+
* {{summary}}
|
|
137
|
+
* {{notes}}
|
|
138
|
+
* Responses:{{#responses}}
|
|
139
|
+
* - {{code}}: {{{message}}}{{/responses}}
|
|
140
|
+
*{{>paramJavadoc}}
|
|
141
|
+
* @return {{^useCoroutines}}[Call]<{{/useCoroutines}}{{#isResponseFile}}[ResponseBody]{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}[{{{.}}}]{{/returnType}}{{^returnType}}[Unit]{{/returnType}}{{/isResponseFile}}{{^useCoroutines}}>{{/useCoroutines}}
|
|
142
|
+
*/
|
|
143
|
+
{{#isDeprecated}}
|
|
144
|
+
@Deprecated("This api was deprecated")
|
|
145
|
+
{{/isDeprecated}}
|
|
146
|
+
{{#formParams}}
|
|
147
|
+
{{#-first}}
|
|
148
|
+
{{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}
|
|
149
|
+
{{/-first}}
|
|
150
|
+
{{/formParams}}
|
|
151
|
+
{{^formParams}}
|
|
152
|
+
{{#prioritizedContentTypes}}
|
|
153
|
+
{{#-first}}
|
|
154
|
+
@Headers({
|
|
155
|
+
"Content-Type:{{{mediaType}}}"
|
|
156
|
+
})
|
|
157
|
+
{{/-first}}
|
|
158
|
+
{{/prioritizedContentTypes}}
|
|
159
|
+
{{/formParams}}
|
|
160
|
+
@{{httpMethod}}("{{{path}}}")
|
|
161
|
+
{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{#useCoroutines}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}}
|
|
162
|
+
|
|
163
|
+
{{/operation}}
|
|
164
|
+
}
|
|
165
|
+
{{/operations}}
|