forked from loafle/openapi-generator-original
Swift5 Vapor 4 client library (#9625)
* [swift5] Add Vapor client library * Try to improve overall spacing (#17) * [swift5] try to remove changes in model and api * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * [swift5] update sample projects * Update samples * [swift5] vapor: return clientResponse when no default case * Update samples Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
This commit is contained in:
parent
c5fefa938a
commit
f923a0ef15
12
bin/configs/swift5-vapor.yaml
Normal file
12
bin/configs/swift5-vapor.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
generatorName: swift5
|
||||
outputDir: samples/client/petstore/swift5/vaporLibrary
|
||||
library: vapor
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/swift5
|
||||
generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
projectName: PetstoreClient
|
||||
useSPMFileStructure: true
|
||||
useClasses: true
|
||||
useBacktickEscapes: true
|
||||
mapFileBinaryToData: true
|
@ -16,7 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||
|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd></dl>|urlsession|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**urlsession**</dt><dd>[DEFAULT] HTTP client: URLSession</dd><dt>**alamofire**</dt><dd>HTTP client: Alamofire</dd><dt>**vapor**</dt><dd>HTTP client: Vapor</dd></dl>|urlsession|
|
||||
|mapFileBinaryToData|[WARNING] This option will be removed and enabled by default in the future once we've enhanced the code to work with `Data` in all the different situations. Map File and Binary to Data (default: false)| |false|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|
||||
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|
||||
|
@ -70,6 +70,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData";
|
||||
protected static final String LIBRARY_ALAMOFIRE = "alamofire";
|
||||
protected static final String LIBRARY_URLSESSION = "urlsession";
|
||||
protected static final String LIBRARY_VAPOR = "vapor";
|
||||
protected static final String RESPONSE_LIBRARY_PROMISE_KIT = "PromiseKit";
|
||||
protected static final String RESPONSE_LIBRARY_RX_SWIFT = "RxSwift";
|
||||
protected static final String RESPONSE_LIBRARY_RESULT = "Result";
|
||||
@ -297,6 +298,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
|
||||
supportedLibraries.put(LIBRARY_URLSESSION, "[DEFAULT] HTTP client: URLSession");
|
||||
supportedLibraries.put(LIBRARY_ALAMOFIRE, "HTTP client: Alamofire");
|
||||
supportedLibraries.put(LIBRARY_VAPOR, "HTTP client: Vapor");
|
||||
|
||||
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use");
|
||||
libraryOption.setEnum(supportedLibraries);
|
||||
@ -499,57 +501,59 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("Podspec.mustache",
|
||||
"",
|
||||
projectName + ".podspec"));
|
||||
supportingFiles.add(new SupportingFile("Cartfile.mustache",
|
||||
"",
|
||||
"Cartfile"));
|
||||
if (!getLibrary().equals(LIBRARY_VAPOR)) {
|
||||
supportingFiles.add(new SupportingFile("Podspec.mustache",
|
||||
"",
|
||||
projectName + ".podspec"));
|
||||
supportingFiles.add(new SupportingFile("Cartfile.mustache",
|
||||
"",
|
||||
"Cartfile"));
|
||||
supportingFiles.add(new SupportingFile("CodableHelper.mustache",
|
||||
sourceFolder,
|
||||
"CodableHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("OpenISO8601DateFormatter.mustache",
|
||||
sourceFolder,
|
||||
"OpenISO8601DateFormatter.swift"));
|
||||
supportingFiles.add(new SupportingFile("JSONDataEncoding.mustache",
|
||||
sourceFolder,
|
||||
"JSONDataEncoding.swift"));
|
||||
supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache",
|
||||
sourceFolder,
|
||||
"JSONEncodingHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache",
|
||||
"",
|
||||
"git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("SynchronizedDictionary.mustache",
|
||||
sourceFolder,
|
||||
"SynchronizedDictionary.swift"));
|
||||
supportingFiles.add(new SupportingFile("XcodeGen.mustache",
|
||||
"",
|
||||
"project.yml"));
|
||||
supportingFiles.add(new SupportingFile("APIHelper.mustache",
|
||||
sourceFolder,
|
||||
"APIHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("Models.mustache",
|
||||
sourceFolder,
|
||||
"Models.swift"));
|
||||
}
|
||||
supportingFiles.add(new SupportingFile("Package.swift.mustache",
|
||||
"",
|
||||
"Package.swift"));
|
||||
supportingFiles.add(new SupportingFile("APIHelper.mustache",
|
||||
sourceFolder,
|
||||
"APIHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("Configuration.mustache",
|
||||
sourceFolder,
|
||||
"Configuration.swift"));
|
||||
supportingFiles.add(new SupportingFile("Extensions.mustache",
|
||||
sourceFolder,
|
||||
"Extensions.swift"));
|
||||
supportingFiles.add(new SupportingFile("Models.mustache",
|
||||
sourceFolder,
|
||||
"Models.swift"));
|
||||
supportingFiles.add(new SupportingFile("APIs.mustache",
|
||||
sourceFolder,
|
||||
"APIs.swift"));
|
||||
supportingFiles.add(new SupportingFile("CodableHelper.mustache",
|
||||
sourceFolder,
|
||||
"CodableHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("OpenISO8601DateFormatter.mustache",
|
||||
sourceFolder,
|
||||
"OpenISO8601DateFormatter.swift"));
|
||||
supportingFiles.add(new SupportingFile("JSONDataEncoding.mustache",
|
||||
sourceFolder,
|
||||
"JSONDataEncoding.swift"));
|
||||
supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache",
|
||||
sourceFolder,
|
||||
"JSONEncodingHelper.swift"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache",
|
||||
"",
|
||||
"git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("SynchronizedDictionary.mustache",
|
||||
sourceFolder,
|
||||
"SynchronizedDictionary.swift"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache",
|
||||
"",
|
||||
".gitignore"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache",
|
||||
"",
|
||||
"README.md"));
|
||||
supportingFiles.add(new SupportingFile("XcodeGen.mustache",
|
||||
"",
|
||||
"project.yml"));
|
||||
|
||||
switch (getLibrary()) {
|
||||
case LIBRARY_ALAMOFIRE:
|
||||
@ -564,6 +568,9 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
sourceFolder,
|
||||
"URLSessionImplementations.swift"));
|
||||
break;
|
||||
case LIBRARY_VAPOR:
|
||||
additionalProperties.put("useVapor", true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4,7 +4,8 @@
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Foundation{{#useVapor}}
|
||||
import Vapor{{/useVapor}}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: Any?]) -> [String: Any]? {
|
||||
|
@ -5,18 +5,26 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
{{#useVapor}}
|
||||
import Vapor
|
||||
{{/useVapor}}
|
||||
|
||||
@available(*, deprecated, renamed: "{{projectName}}")
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} typealias {{projectName}}API = {{projectName}}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{projectName}} {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var basePath = "{{{basePath}}}"
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var credential: URLCredential?
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var customHeaders: [String: String] = [:]{{#useAlamofire}}
|
||||
{{#useVapor}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var customHeaders: HTTPHeaders = [:]
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var customHeaders: [String: String] = [:]
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var credential: URLCredential?{{#useAlamofire}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory(){{/useAlamofire}}{{#useURLSession}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory(){{/useURLSession}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiResponseQueue: DispatchQueue = .main
|
||||
}
|
||||
{{/useVapor}}
|
||||
}{{^useVapor}}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder<T> {
|
||||
var credential: URLCredential?
|
||||
@ -63,4 +71,4 @@ import Foundation
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol RequestBuilderFactory {
|
||||
func getNonDecodableBuilder<T>() -> RequestBuilder<T>.Type
|
||||
func getBuilder<T: Decodable>() -> RequestBuilder<T>.Type
|
||||
}
|
||||
}{{/useVapor}}
|
||||
|
@ -4,7 +4,8 @@
|
||||
// https://openapi-generator.tech
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Foundation{{#useVapor}}
|
||||
import Vapor{{/useVapor}}
|
||||
|
||||
{{#swiftUseApiNamespace}}
|
||||
@available(*, deprecated, renamed: "{{projectName}}.Configuration")
|
||||
@ -13,11 +14,15 @@ import Foundation
|
||||
extension {{projectName}} {
|
||||
{{/swiftUseApiNamespace}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class Configuration {
|
||||
{{#useVapor}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiClient: Vapor.Client? = nil
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiWrapper: (inout Vapor.ClientRequest) throws -> () = { _ in }
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var contentConfiguration = ContentConfiguration.default(){{/useVapor}}{{^useVapor}}
|
||||
// This value is used to configure the date formatter that is used to serialize dates into JSON format.
|
||||
// You must set it prior to encoding any dates, and it will only be read once.
|
||||
@available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.")
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"{{/useVapor}}
|
||||
}
|
||||
{{#swiftUseApiNamespace}}
|
||||
}
|
||||
|
||||
{{/swiftUseApiNamespace}}
|
@ -8,7 +8,8 @@ import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif{{#usePromiseKit}}
|
||||
import PromiseKit{{/usePromiseKit}}
|
||||
import PromiseKit{{/usePromiseKit}}{{#useVapor}}
|
||||
import Vapor{{/useVapor}}{{^useVapor}}
|
||||
|
||||
extension Bool: JSONEncodable {
|
||||
func encodeToJSON() -> Any { return self as Any }
|
||||
@ -94,7 +95,7 @@ extension UUID: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self.uuidString
|
||||
}
|
||||
}{{#generateModelAdditionalProperties}}
|
||||
}{{/useVapor}}{{#generateModelAdditionalProperties}}
|
||||
|
||||
extension String: CodingKey {
|
||||
|
||||
@ -180,13 +181,13 @@ extension KeyedDecodingContainerProtocol {
|
||||
return map
|
||||
}
|
||||
|
||||
}{{/generateModelAdditionalProperties}}
|
||||
}{{/generateModelAdditionalProperties}}{{^useVapor}}
|
||||
|
||||
extension HTTPURLResponse {
|
||||
var isStatusCodeSuccessful: Bool {
|
||||
return Array(200 ..< 300).contains(statusCode)
|
||||
}
|
||||
}{{#usePromiseKit}}
|
||||
}{{/useVapor}}{{#usePromiseKit}}
|
||||
|
||||
extension RequestBuilder {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func execute() -> Promise<Response<T>> {
|
||||
@ -201,4 +202,39 @@ extension RequestBuilder {
|
||||
}
|
||||
return deferred.promise
|
||||
}
|
||||
}{{/usePromiseKit}}
|
||||
}{{/usePromiseKit}}{{#useVapor}}
|
||||
|
||||
extension UUID: Content { }
|
||||
|
||||
extension URL: Content { }
|
||||
|
||||
extension Bool: Content { }
|
||||
|
||||
extension Set: ResponseEncodable where Element: Content {
|
||||
public func encodeResponse(for request: Vapor.Request) -> EventLoopFuture<Vapor.Response> {
|
||||
let response = Vapor.Response()
|
||||
do {
|
||||
try response.content.encode(Array(self))
|
||||
} catch {
|
||||
return request.eventLoop.makeFailedFuture(error)
|
||||
}
|
||||
return request.eventLoop.makeSucceededFuture(response)
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: RequestDecodable where Element: Content {
|
||||
public static func decodeRequest(_ request: Vapor.Request) -> EventLoopFuture<Self> {
|
||||
do {
|
||||
let content = try request.content.decode([Element].self)
|
||||
return request.eventLoop.makeSucceededFuture(Set(content))
|
||||
} catch {
|
||||
return request.eventLoop.makeFailedFuture(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Set: Content where Element: Content { }
|
||||
|
||||
extension AnyCodable: Content {}
|
||||
{{/useVapor}}
|
||||
|
||||
|
@ -5,10 +5,15 @@ import PackageDescription
|
||||
let package = Package(
|
||||
name: "{{projectName}}",
|
||||
platforms: [
|
||||
{{#useVapor}}
|
||||
.macOS(.v10_15),
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
.iOS(.v9),
|
||||
.macOS(.v10_11),
|
||||
.tvOS(.v9),
|
||||
.watchOS(.v3),
|
||||
{{/useVapor}}
|
||||
],
|
||||
products: [
|
||||
// Products define the executables and libraries produced by a package, and make them visible to other packages.
|
||||
@ -23,6 +28,9 @@ let package = Package(
|
||||
{{#useAlamofire}}
|
||||
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1"),
|
||||
{{/useAlamofire}}
|
||||
{{#useVapor}}
|
||||
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0")
|
||||
{{/useVapor}}
|
||||
{{#usePromiseKit}}
|
||||
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.15.3"),
|
||||
{{/usePromiseKit}}
|
||||
@ -35,7 +43,7 @@ let package = Package(
|
||||
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
|
||||
.target(
|
||||
name: "{{projectName}}",
|
||||
dependencies: ["AnyCodable", {{#useAlamofire}}"Alamofire", {{/useAlamofire}}{{#usePromiseKit}}"PromiseKit", {{/usePromiseKit}}{{#useRxSwift}}"RxSwift"{{/useRxSwift}}],
|
||||
dependencies: ["AnyCodable", {{#useVapor}}"Vapor", {{/useVapor}}{{#useAlamofire}}"Alamofire", {{/useAlamofire}}{{#usePromiseKit}}"PromiseKit", {{/usePromiseKit}}{{#useRxSwift}}"RxSwift"{{/useRxSwift}}],
|
||||
path: "{{#swiftPackagePath}}{{swiftPackagePath}}{{/swiftPackagePath}}{{^swiftPackagePath}}{{#useSPMFileStructure}}Sources/{{projectName}}{{/useSPMFileStructure}}{{^useSPMFileStructure}}{{projectName}}/Classes{{/useSPMFileStructure}}{{/swiftPackagePath}}"
|
||||
),
|
||||
]
|
||||
|
@ -19,6 +19,13 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||
|
||||
## Installation
|
||||
|
||||
{{#useVapor}}
|
||||
Add the following entry in your Package.swift:
|
||||
|
||||
> .package(path: "./{{{projectName}}}")
|
||||
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
### Carthage
|
||||
|
||||
Run `carthage update`
|
||||
@ -27,7 +34,7 @@ Run `carthage update`
|
||||
|
||||
Run `pod install`
|
||||
|
||||
## Documentation for API Endpoints
|
||||
{{/useVapor}}## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *{{basePath}}*
|
||||
|
||||
|
@ -10,21 +10,26 @@ import PromiseKit{{/usePromiseKit}}{{#useRxSwift}}
|
||||
import RxSwift{{/useRxSwift}}{{#useCombine}}
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif{{/useCombine}}{{#swiftUseApiNamespace}}
|
||||
#endif{{/useCombine}}{{#useVapor}}
|
||||
import Vapor{{/useVapor}}
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif{{#swiftUseApiNamespace}}
|
||||
|
||||
extension {{projectName}} {
|
||||
{{/swiftUseApiNamespace}}
|
||||
|
||||
{{#description}}
|
||||
/** {{description}} */{{/description}}
|
||||
/** {{{description}}} */{{/description}}
|
||||
{{#objcCompatible}}@objc {{/objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{classname}}{{#objcCompatible}} : NSObject{{/objcCompatible}} {
|
||||
{{#operation}}
|
||||
|
||||
{{#allParams}}
|
||||
{{#isEnum}}
|
||||
/**
|
||||
* enum for parameter {{paramName}}
|
||||
*/
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, CaseIterable {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, CaseIterable{{#useVapor}}, Content{{/useVapor}} {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
case {{name}} = {{{value}}}
|
||||
@ -34,6 +39,7 @@ extension {{projectName}} {
|
||||
|
||||
{{/isEnum}}
|
||||
{{/allParams}}
|
||||
{{^useVapor}}
|
||||
{{^usePromiseKit}}
|
||||
{{^useRxSwift}}
|
||||
{{^useResult}}
|
||||
@ -69,6 +75,7 @@ extension {{projectName}} {
|
||||
{{/useResult}}
|
||||
{{/useRxSwift}}
|
||||
{{/usePromiseKit}}
|
||||
{{/useVapor}}
|
||||
{{#usePromiseKit}}
|
||||
/**
|
||||
{{#summary}}
|
||||
@ -196,6 +203,126 @@ extension {{projectName}} {
|
||||
}
|
||||
}
|
||||
{{/useResult}}
|
||||
{{#useVapor}}
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{summary}}}
|
||||
{{/summary}}
|
||||
{{httpMethod}} {{{path}}}{{#notes}}
|
||||
{{{notes}}}{{/notes}}{{#subresourceOperation}}
|
||||
subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}}
|
||||
defaultResponse: {{defaultResponse}}{{/defaultResponse}}
|
||||
{{#authMethods}}
|
||||
- {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}:
|
||||
- type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}}
|
||||
- name: {{name}}
|
||||
{{/authMethods}}
|
||||
{{#hasResponseHeaders}}
|
||||
- responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}]
|
||||
{{/hasResponseHeaders}}
|
||||
{{#externalDocs}}
|
||||
- externalDocs: {{externalDocs}}
|
||||
{{/externalDocs}}
|
||||
{{#allParams}}
|
||||
- parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||
{{/allParams}}
|
||||
- returns: `EventLoopFuture` of `ClientResponse` {{{description}}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
{{/isDeprecated}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}Raw({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse> {
|
||||
{{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}}
|
||||
let {{paramName}}PreEscape = String(describing: {{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}{{paramName}}{{/isEnum}})
|
||||
let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
||||
path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}}
|
||||
let URLString = {{projectName}}.basePath + path
|
||||
|
||||
guard let apiClient = {{#swiftUseApiNamespace}}{{projectName}}.{{/swiftUseApiNamespace}}Configuration.apiClient else {
|
||||
fatalError("Configuration.apiClient is not set.")
|
||||
}
|
||||
|
||||
return apiClient.send(.{{httpMethod}}, headers: headers, to: URI(string: URLString)) { request in
|
||||
try {{#swiftUseApiNamespace}}{{projectName}}.{{/swiftUseApiNamespace}}Configuration.apiWrapper(&request)
|
||||
{{#hasHeaderParams}}{{#headerParams}}
|
||||
request.headers.add(name: "{{baseName}}", value: {{#isArray}}{{paramName}}{{^required}}?{{/required}}.map { $0{{#isEnum}}.rawValue{{/isEnum}}.description }.description{{/isArray}}{{^isArray}}{{#isEnum}}{{paramName}}{{^required}}?{{/required}}.rawValue.description{{/isEnum}}{{^isEnum}}{{paramName}}{{^required}}?{{/required}}.description{{/isEnum}}{{/isArray}}{{^required}} ?? ""{{/required}})
|
||||
{{/headerParams}}{{/hasHeaderParams}}
|
||||
{{#hasQueryParams}}struct QueryParams: Content {
|
||||
{{#queryParams}}
|
||||
var {{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}
|
||||
{{/queryParams}}
|
||||
}
|
||||
try request.query.encode(QueryParams({{#queryParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/queryParams}})){{/hasQueryParams}}
|
||||
{{#hasBodyParam}}
|
||||
{{#bodyParam}}{{#required}}{{#isBinary}}request.body = ByteBuffer(data: {{paramName}}){{/isBinary}}{{^isBinary}}{{#isFile}}request.body = ByteBuffer(data: {{paramName}}){{/isFile}}try request.content.encode({{paramName}}, using: Configuration.contentConfiguration.requireEncoder(for: {{{dataType}}}.defaultContentType)){{/isBinary}}{{/required}}{{^required}}if let body = {{paramName}} {
|
||||
|
||||
{{#isBinary}}request.body = ByteBuffer(data: body){{/isBinary}}{{^isBinary}}{{#isFile}}request.body = ByteBuffer(data: body){{/isFile}}try request.content.encode(body, using: Configuration.contentConfiguration.requireEncoder(for: {{{dataType}}}.defaultContentType)){{/isBinary}}
|
||||
}{{/required}}{{/bodyParam}}
|
||||
{{/hasBodyParam}}
|
||||
{{#hasFormParams}}struct FormParams: Content {
|
||||
static let defaultContentType = Vapor.HTTPMediaType.formData
|
||||
{{#formParams}}
|
||||
var {{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}
|
||||
{{/formParams}}
|
||||
}
|
||||
try request.content.encode(FormParams({{#formParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/formParams}}), using: Configuration.contentConfiguration.requireEncoder(for: FormParams.defaultContentType)){{/hasFormParams}}
|
||||
try beforeSend(&request)
|
||||
}
|
||||
}
|
||||
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} {
|
||||
{{#responses}}
|
||||
case http{{code}}({{#dataType}}value: {{{dataType}}}, {{/dataType}}raw: ClientResponse)
|
||||
{{/responses}}
|
||||
{{^hasDefaultResponse}}
|
||||
case http0(raw: ClientResponse)
|
||||
{{/hasDefaultResponse}}
|
||||
}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
{{{summary}}}
|
||||
{{/summary}}
|
||||
{{httpMethod}} {{{path}}}{{#notes}}
|
||||
{{{notes}}}{{/notes}}{{#subresourceOperation}}
|
||||
subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}}
|
||||
defaultResponse: {{defaultResponse}}{{/defaultResponse}}
|
||||
{{#authMethods}}
|
||||
- {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}:
|
||||
- type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}}
|
||||
- name: {{name}}
|
||||
{{/authMethods}}
|
||||
{{#hasResponseHeaders}}
|
||||
- responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}]
|
||||
{{/hasResponseHeaders}}
|
||||
{{#externalDocs}}
|
||||
- externalDocs: {{externalDocs}}
|
||||
{{/externalDocs}}
|
||||
{{#allParams}}
|
||||
- parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{{description}}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||
{{/allParams}}
|
||||
- returns: `EventLoopFuture` of `{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}` {{{description}}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@available(*, deprecated, message: "This operation is deprecated.")
|
||||
{{/isDeprecated}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isArray}}[{{enumName}}_{{operationId}}]{{/isArray}}{{^isArray}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> {
|
||||
return {{operationId}}Raw({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: headers, beforeSend: beforeSend).flatMapThrowing { response -> {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} in
|
||||
switch response.status.code {
|
||||
{{#responses}}
|
||||
{{#isDefault}}default{{/isDefault}}{{^isDefault}}case {{code}}{{/isDefault}}:
|
||||
return .http{{code}}({{#dataType}}value: {{#isBinary}}Data(buffer: response.body ?? ByteBuffer()){{/isBinary}}{{^isBinary}}{{#isFile}}Data(buffer: response.body ?? ByteBuffer()){{/isFile}}{{^isFile}}try response.content.decode({{{dataType}}}.self, using: Configuration.contentConfiguration.requireDecoder(for: {{{dataType}}}.defaultContentType)){{/isFile}}{{/isBinary}}, {{/dataType}}raw: response)
|
||||
{{/responses}}
|
||||
{{^hasDefaultResponse}}
|
||||
default:
|
||||
return .http0(raw: response)
|
||||
{{/hasDefaultResponse}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
|
||||
/**
|
||||
{{#summary}}
|
||||
@ -268,7 +395,7 @@ extension {{projectName}} {
|
||||
|
||||
return requestBuilder.init(method: "{{httpMethod}}", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
{{/useVapor}}
|
||||
{{/operation}}
|
||||
}
|
||||
{{#swiftUseApiNamespace}}
|
||||
|
@ -14,7 +14,9 @@ Method | HTTP request | Description
|
||||
```swift
|
||||
{{^usePromiseKit}}
|
||||
{{^useRxSwift}}
|
||||
{{^useVapor}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping (_ data: {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)
|
||||
{{/useVapor}}
|
||||
{{/useRxSwift}}
|
||||
{{/usePromiseKit}}
|
||||
{{#usePromiseKit}}
|
||||
@ -23,6 +25,9 @@ Method | HTTP request | Description
|
||||
{{#useRxSwift}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
|
||||
{{/useRxSwift}}
|
||||
{{#useVapor}}
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}>
|
||||
{{/useVapor}}
|
||||
```
|
||||
|
||||
{{{summary}}}{{#notes}}
|
||||
@ -39,6 +44,7 @@ import {{{projectName}}}
|
||||
|
||||
{{^usePromiseKit}}
|
||||
{{^useRxSwift}}
|
||||
{{^useVapor}}
|
||||
{{#summary}}
|
||||
// {{{.}}}
|
||||
{{/summary}}
|
||||
@ -52,6 +58,7 @@ import {{{projectName}}}
|
||||
dump(response)
|
||||
}
|
||||
}
|
||||
{{/useVapor}}
|
||||
{{/useRxSwift}}
|
||||
{{/usePromiseKit}}
|
||||
{{#usePromiseKit}}
|
||||
@ -69,6 +76,27 @@ import {{{projectName}}}
|
||||
{{#useRxSwift}}
|
||||
// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new
|
||||
{{/useRxSwift}}
|
||||
{{#useVapor}}
|
||||
{{#summary}}
|
||||
// {{{.}}}
|
||||
{{/summary}}
|
||||
{{classname}}.{{{operationId}}}({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).whenComplete { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
// process error
|
||||
case .success(let response):
|
||||
switch response {
|
||||
// process decoded response value or raw ClientResponse
|
||||
{{#responses}}
|
||||
case .http{{code}}(let value, let raw):
|
||||
{{/responses}}
|
||||
{{^hasDefaultResponse}}
|
||||
case .http0(let value, let raw):
|
||||
{{/hasDefaultResponse}}
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/useVapor}}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@ -80,7 +108,23 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
{{#useVapor}}
|
||||
#### {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}
|
||||
|
||||
```swift
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} {
|
||||
{{#responses}}
|
||||
case http{{code}}(value: {{#dataType}}{{dataType}}?{{/dataType}}{{^dataType}}Void?{{/dataType}}, raw: ClientResponse)
|
||||
{{/responses}}
|
||||
{{^hasDefaultResponse}}
|
||||
case http0(value: {{#returnType}}{{returnType}}?{{/returnType}}{{^returnType}}Void?{{/returnType}}, raw: ClientResponse)
|
||||
{{/hasDefaultResponse}}
|
||||
}
|
||||
```
|
||||
{{/useVapor}}
|
||||
{{^useVapor}}
|
||||
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}Void (empty response body){{/returnType}}
|
||||
{{/useVapor}}
|
||||
|
||||
### Authorization
|
||||
|
||||
|
@ -8,7 +8,8 @@
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
#endif{{#useVapor}}
|
||||
import Vapor{{/useVapor}}
|
||||
{{#swiftUseApiNamespace}}
|
||||
|
||||
@available(*, deprecated, renamed: "{{projectName}}.{{classname}}")
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Codable, CaseIterable {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
case {{name}} = {{{value}}}
|
||||
case {{{name}}} = {{{value}}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable, CaseIterable {
|
||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
case {{name}} = {{{value}}}
|
||||
case {{{name}}} = {{{value}}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{classname}}: Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
|
||||
{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable {
|
||||
{{/objcCompatible}}
|
||||
|
||||
@ -9,12 +9,12 @@
|
||||
{{/allVars}}
|
||||
{{#allVars}}
|
||||
{{#isEnum}}
|
||||
{{#description}}/** {{description}} */
|
||||
{{#description}}/** {{{description}}} */
|
||||
{{/description}}{{#deprecated}}@available(*, deprecated, message: "This property is deprecated.")
|
||||
{{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#description}}/** {{description}} */
|
||||
{{#description}}/** {{{description}}} */
|
||||
{{/description}}{{#deprecated}}@available(*, deprecated, message: "This property is deprecated.")
|
||||
{{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}
|
||||
{{#objcCompatible}}
|
||||
@ -102,4 +102,4 @@
|
||||
{{/allVars}}
|
||||
{{#generateModelAdditionalProperties}}{{#additionalPropertiesType}}hasher.combine(additionalProperties.hashValue){{/additionalPropertiesType}}{{/generateModelAdditionalProperties}}
|
||||
}{{/vendorExtensions.x-swift-hashable}}{{/useClasses}}{{/objcCompatible}}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
public enum {{classname}}: Codable {
|
||||
public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}} {
|
||||
{{#oneOf}}
|
||||
case type{{.}}({{.}})
|
||||
{{/oneOf}}
|
||||
|
@ -11,8 +11,8 @@ public typealias PetstoreClientAPI = PetstoreClient
|
||||
|
||||
open class PetstoreClient {
|
||||
public static var basePath = "http://petstore.swagger.io:80/v2"
|
||||
public static var credential: URLCredential?
|
||||
public static var customHeaders: [String: String] = [:]
|
||||
public static var credential: URLCredential?
|
||||
public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
|
||||
public static var apiResponseQueue: DispatchQueue = .main
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class AnotherFakeAPI {
|
||||
|
||||
/**
|
||||
To test special tags
|
||||
|
||||
@ -50,5 +54,4 @@ open class AnotherFakeAPI {
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class FakeAPI {
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input boolean as post body (optional)
|
||||
@ -680,5 +684,4 @@ open class FakeAPI {
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class FakeClassnameTags123API {
|
||||
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
@ -53,5 +57,4 @@ open class FakeClassnameTags123API {
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class PetAPI {
|
||||
|
||||
/**
|
||||
Add a new pet to the store
|
||||
|
||||
@ -479,5 +483,4 @@ open class PetAPI {
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class StoreAPI {
|
||||
|
||||
/**
|
||||
Delete purchase order by ID
|
||||
|
||||
@ -185,5 +189,4 @@ open class StoreAPI {
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,12 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class UserAPI {
|
||||
|
||||
/**
|
||||
Create user
|
||||
|
||||
@ -362,5 +366,4 @@ open class UserAPI {
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
import Foundation
|
||||
|
||||
open class Configuration {
|
||||
|
||||
// This value is used to configure the date formatter that is used to serialize dates into JSON format.
|
||||
// You must set it prior to encoding any dates, and it will only be read once.
|
||||
@available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.")
|
||||
|
@ -33,3 +33,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(mapMapString, forKey: .mapMapString)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct Animal: Codable, Hashable {
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct ApiResponse: Codable, Hashable {
|
||||
try container.encodeIfPresent(message, forKey: .message)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct ArrayTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,3 +50,4 @@ public struct Capitalization: Codable, Hashable {
|
||||
try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct Cat: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct CatAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct Category: Codable, Hashable {
|
||||
try container.encode(name, forKey: .name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,3 +30,4 @@ public struct ClassModel: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct Client: Codable, Hashable {
|
||||
try container.encodeIfPresent(client, forKey: .client)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct Dog: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct DogAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,3 +41,4 @@ public struct EnumArrays: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,3 +63,4 @@ public struct EnumTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(outerEnum, forKey: .outerEnum)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,3 +31,4 @@ public struct File: Codable, Hashable {
|
||||
try container.encodeIfPresent(sourceURI, forKey: .sourceURI)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct FileSchemaTestClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(files, forKey: .files)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,3 +77,4 @@ public struct FormatTest: Codable, Hashable {
|
||||
try container.encode(password, forKey: .password)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct HasOnlyReadOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(foo, forKey: .foo)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct List: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123list, forKey: ._123list)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,3 +45,4 @@ public struct MapTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(indirectMap, forKey: .indirectMap)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(map, forKey: .map)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,3 +34,4 @@ public struct Model200Response: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,3 +42,4 @@ public struct Name: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123number, forKey: ._123number)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct NumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(justNumber, forKey: .justNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,3 +55,4 @@ public struct Order: Codable, Hashable {
|
||||
try container.encodeIfPresent(complete, forKey: .complete)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct OuterComposite: Codable, Hashable {
|
||||
try container.encodeIfPresent(myBoolean, forKey: .myBoolean)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,3 +55,4 @@ public struct Pet: Codable, Hashable {
|
||||
try container.encodeIfPresent(status, forKey: .status)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct ReadOnlyFirst: Codable, Hashable {
|
||||
try container.encodeIfPresent(baz, forKey: .baz)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,3 +30,4 @@ public struct Return: Codable, Hashable {
|
||||
try container.encodeIfPresent(_return, forKey: ._return)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct SpecialModelName: Codable, Hashable {
|
||||
try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,3 +49,4 @@ public struct StringBooleanMap: Codable, Hashable {
|
||||
additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct Tag: Codable, Hashable {
|
||||
try container.encodeIfPresent(name, forKey: .name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,3 +45,4 @@ public struct TypeHolderDefault: Codable, Hashable {
|
||||
try container.encode(arrayItem, forKey: .arrayItem)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,3 +45,4 @@ public struct TypeHolderExample: Codable, Hashable {
|
||||
try container.encode(arrayItem, forKey: .arrayItem)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,3 +58,4 @@ public struct User: Codable, Hashable {
|
||||
try container.encodeIfPresent(userStatus, forKey: .userStatus)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@ public typealias PetstoreClientAPI = PetstoreClient
|
||||
|
||||
open class PetstoreClient {
|
||||
public static var basePath = "http://petstore.swagger.io:80/v2"
|
||||
public static var credential: URLCredential?
|
||||
public static var customHeaders: [String: String] = [:]
|
||||
public static var credential: URLCredential?
|
||||
public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory()
|
||||
public static var apiResponseQueue: DispatchQueue = .main
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class AnotherFakeAPI {
|
||||
|
||||
/**
|
||||
To test special tags
|
||||
|
||||
@ -58,5 +62,4 @@ open class AnotherFakeAPI {
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class FakeAPI {
|
||||
|
||||
/**
|
||||
|
||||
- parameter body: (body) Input boolean as post body (optional)
|
||||
@ -743,5 +747,4 @@ open class FakeAPI {
|
||||
|
||||
return requestBuilder.init(method: "GET", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class FakeClassnameTags123API {
|
||||
|
||||
/**
|
||||
To test class name in snake case
|
||||
|
||||
@ -61,5 +65,4 @@ open class FakeClassnameTags123API {
|
||||
|
||||
return requestBuilder.init(method: "PATCH", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class PetAPI {
|
||||
|
||||
/**
|
||||
Add a new pet to the store
|
||||
|
||||
@ -527,5 +531,4 @@ open class PetAPI {
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class StoreAPI {
|
||||
|
||||
/**
|
||||
Delete purchase order by ID
|
||||
|
||||
@ -208,5 +212,4 @@ open class StoreAPI {
|
||||
|
||||
return requestBuilder.init(method: "POST", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,12 @@ import Foundation
|
||||
#if canImport(Combine)
|
||||
import Combine
|
||||
#endif
|
||||
#if canImport(AnyCodable)
|
||||
import AnyCodable
|
||||
#endif
|
||||
|
||||
open class UserAPI {
|
||||
|
||||
/**
|
||||
Create user
|
||||
|
||||
@ -405,5 +409,4 @@ open class UserAPI {
|
||||
|
||||
return requestBuilder.init(method: "PUT", URLString: (urlComponents?.string ?? URLString), parameters: parameters, headers: headerParameters)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
import Foundation
|
||||
|
||||
open class Configuration {
|
||||
|
||||
// This value is used to configure the date formatter that is used to serialize dates into JSON format.
|
||||
// You must set it prior to encoding any dates, and it will only be read once.
|
||||
@available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.")
|
||||
|
@ -33,3 +33,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(mapMapString, forKey: .mapMapString)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct Animal: Codable, Hashable {
|
||||
try container.encodeIfPresent(color, forKey: .color)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct ApiResponse: Codable, Hashable {
|
||||
try container.encodeIfPresent(message, forKey: .message)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct ArrayTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,3 +50,4 @@ public struct Capitalization: Codable, Hashable {
|
||||
try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct Cat: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct CatAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(declawed, forKey: .declawed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct Category: Codable, Hashable {
|
||||
try container.encode(name, forKey: .name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,3 +30,4 @@ public struct ClassModel: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct Client: Codable, Hashable {
|
||||
try container.encodeIfPresent(client, forKey: .client)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct Dog: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct DogAllOf: Codable, Hashable {
|
||||
try container.encodeIfPresent(breed, forKey: .breed)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,3 +41,4 @@ public struct EnumArrays: Codable, Hashable {
|
||||
try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,3 +63,4 @@ public struct EnumTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(outerEnum, forKey: .outerEnum)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,3 +31,4 @@ public struct File: Codable, Hashable {
|
||||
try container.encodeIfPresent(sourceURI, forKey: .sourceURI)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct FileSchemaTestClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(files, forKey: .files)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,3 +77,4 @@ public struct FormatTest: Codable, Hashable {
|
||||
try container.encode(password, forKey: .password)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct HasOnlyReadOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(foo, forKey: .foo)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct List: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123list, forKey: ._123list)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,3 +45,4 @@ public struct MapTest: Codable, Hashable {
|
||||
try container.encodeIfPresent(indirectMap, forKey: .indirectMap)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable {
|
||||
try container.encodeIfPresent(map, forKey: .map)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,3 +34,4 @@ public struct Model200Response: Codable, Hashable {
|
||||
try container.encodeIfPresent(_class, forKey: ._class)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,3 +42,4 @@ public struct Name: Codable, Hashable {
|
||||
try container.encodeIfPresent(_123number, forKey: ._123number)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,3 +29,4 @@ public struct NumberOnly: Codable, Hashable {
|
||||
try container.encodeIfPresent(justNumber, forKey: .justNumber)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,3 +55,4 @@ public struct Order: Codable, Hashable {
|
||||
try container.encodeIfPresent(complete, forKey: .complete)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,3 +37,4 @@ public struct OuterComposite: Codable, Hashable {
|
||||
try container.encodeIfPresent(myBoolean, forKey: .myBoolean)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,3 +55,4 @@ public struct Pet: Codable, Hashable {
|
||||
try container.encodeIfPresent(status, forKey: .status)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,3 +33,4 @@ public struct ReadOnlyFirst: Codable, Hashable {
|
||||
try container.encodeIfPresent(baz, forKey: .baz)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,3 +30,4 @@ public struct Return: Codable, Hashable {
|
||||
try container.encodeIfPresent(_return, forKey: ._return)
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user