forked from loafle/openapi-generator-original
[swift5][client] improve code formatting (#11124)
* [swift][client] improve code formatting with multiple response as * [kotlin][vertx] update sample project
This commit is contained in:
parent
fedc54af9a
commit
42d635b463
@ -23,9 +23,9 @@ extension {{projectName}}API {
|
||||
/** {{{.}}} */{{/description}}
|
||||
{{#objcCompatible}}@objc {{/objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{classname}}{{#objcCompatible}} : NSObject{{/objcCompatible}} {
|
||||
{{#operation}}
|
||||
|
||||
{{#allParams}}
|
||||
{{#isEnum}}
|
||||
|
||||
/**
|
||||
* enum for parameter {{paramName}}
|
||||
*/
|
||||
@ -36,7 +36,6 @@ extension {{projectName}}API {
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
||||
|
||||
{{/isEnum}}
|
||||
{{/allParams}}
|
||||
{{^useVapor}}
|
||||
@ -45,6 +44,7 @@ extension {{projectName}}API {
|
||||
{{^useResult}}
|
||||
{{^useCombine}}
|
||||
{{^useAsyncAwait}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -80,6 +80,7 @@ extension {{projectName}}API {
|
||||
{{/usePromiseKit}}
|
||||
{{/useVapor}}
|
||||
{{#usePromiseKit}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -111,6 +112,7 @@ extension {{projectName}}API {
|
||||
}
|
||||
{{/usePromiseKit}}
|
||||
{{#useRxSwift}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -147,6 +149,7 @@ extension {{projectName}}API {
|
||||
}
|
||||
{{/useRxSwift}}
|
||||
{{#useCombine}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -186,6 +189,7 @@ extension {{projectName}}API {
|
||||
#endif
|
||||
{{/useCombine}}
|
||||
{{#useAsyncAwait}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -229,6 +233,7 @@ extension {{projectName}}API {
|
||||
}
|
||||
{{/useAsyncAwait}}
|
||||
{{#useResult}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -241,7 +246,7 @@ extension {{projectName}}API {
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
{{/isDeprecated}}
|
||||
@discardableResult
|
||||
open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask {
|
||||
return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in
|
||||
switch result {
|
||||
{{#returnType}}
|
||||
@ -259,6 +264,7 @@ extension {{projectName}}API {
|
||||
}
|
||||
{{/useResult}}
|
||||
{{#useVapor}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{.}}}
|
||||
@ -380,7 +386,6 @@ extension {{projectName}}API {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
|
||||
|
@ -60,5 +60,4 @@ open class AnotherFakeAPI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
POST /fake/outer/boolean
|
||||
Test serialization of outer boolean types
|
||||
@ -110,7 +109,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
POST /fake/outer/composite
|
||||
Test serialization of object with outer number type
|
||||
@ -159,7 +157,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
POST /fake/outer/number
|
||||
Test serialization of outer number types
|
||||
@ -208,7 +205,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
POST /fake/outer/string
|
||||
Test serialization of outer string types
|
||||
@ -257,7 +253,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
PUT /fake/body-with-file-schema
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
@ -304,7 +299,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
PUT /fake/body-with-query-params
|
||||
- parameter query: (query)
|
||||
@ -358,7 +352,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
To test \"client\" model
|
||||
PATCH /fake
|
||||
@ -407,7 +400,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
POST /fake
|
||||
@ -507,7 +499,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* enum for parameter enumHeaderStringArray
|
||||
*/
|
||||
@ -661,7 +652,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Fake endpoint to test group parameters (optional)
|
||||
DELETE /fake
|
||||
@ -736,7 +726,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
test inline additionalProperties
|
||||
POST /fake/inline-additionalProperties
|
||||
@ -783,7 +772,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
test json serialization of form data
|
||||
GET /fake/jsonFormData
|
||||
@ -836,7 +824,6 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
PUT /fake/test-query-parameters
|
||||
To test the collection format in query parameters
|
||||
@ -904,5 +891,4 @@ open class FakeAPI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -66,5 +66,4 @@ open class FakeClassnameTags123API {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Deletes a pet
|
||||
DELETE /pet/{petId}
|
||||
@ -130,7 +129,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* enum for parameter status
|
||||
*/
|
||||
@ -203,7 +201,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Finds Pets by tags
|
||||
GET /pet/findByTags
|
||||
@ -269,7 +266,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Find pet by ID
|
||||
GET /pet/{petId}
|
||||
@ -332,7 +328,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Update an existing pet
|
||||
PUT /pet
|
||||
@ -394,7 +389,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Updates a pet in the store with form data
|
||||
POST /pet/{petId}
|
||||
@ -458,7 +452,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
uploads an image
|
||||
POST /pet/{petId}/uploadImage
|
||||
@ -522,7 +515,6 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
uploads an image (required)
|
||||
POST /fake/{petId}/uploadImageWithRequiredFile
|
||||
@ -585,5 +577,4 @@ open class PetAPI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -66,7 +66,6 @@ open class StoreAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns pet inventories by status
|
||||
GET /store/inventory
|
||||
@ -118,7 +117,6 @@ open class StoreAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Find purchase order by ID
|
||||
GET /store/order/{order_id}
|
||||
@ -175,7 +173,6 @@ open class StoreAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Place an order for a pet
|
||||
POST /store/order
|
||||
@ -224,5 +221,4 @@ open class StoreAPI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
POST /user/createWithArray
|
||||
@ -102,7 +101,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Creates list of users with given input array
|
||||
POST /user/createWithList
|
||||
@ -146,7 +144,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Delete user
|
||||
DELETE /user/{username}
|
||||
@ -200,7 +197,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get user by user name
|
||||
GET /user/{username}
|
||||
@ -255,7 +251,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Logs user into the system
|
||||
GET /user/login
|
||||
@ -317,7 +312,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Logs out current logged in user session
|
||||
GET /user/logout
|
||||
@ -358,7 +352,6 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Updated user
|
||||
PUT /user/{username}
|
||||
@ -414,5 +407,4 @@ open class UserAPI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.server.api.model
|
||||
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import com.fasterxml.jackson.annotation.JsonInclude
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
data class ApiResponse (
|
||||
var code: kotlin.Int? = null,
|
||||
var type: kotlin.String? = null,
|
||||
var message: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user