Fix array of form parameters (#324)

* fix array of form parameters

* fix description for array of form parameters

* fix map of enum value
This commit is contained in:
William Cheng 2018-05-06 00:39:38 +08:00 committed by GitHub
parent 90ac9d030c
commit 3c666a6d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 347 additions and 144 deletions

View File

@ -4086,7 +4086,43 @@ public class DefaultCodegen implements CodegenConfig {
CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER);
// key => property name
// value => property schema
codegenParameter = fromFormProperty(entry.getKey(), entry.getValue(), imports);
String collectionFormat = null;
Schema s = entry.getValue();
// array of schema
if (ModelUtils.isArraySchema(s)) {
final ArraySchema arraySchema = (ArraySchema) s;
Schema inner = arraySchema.getItems();
if (inner == null) {
LOGGER.warn("warning! No inner type supplied for array parameter \"" + s.getName() + "\", using String");
inner = new StringSchema().description("//TODO automatically added by openapi-generator due to missing iner type definition in the spec");
arraySchema.setItems(inner);
}
//TODO fix collectformat for form parameters
//collectionFormat = getCollectionFormat(s);
// default to csv:
collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat;
codegenParameter = fromFormProperty(entry.getKey(), inner, imports);
CodegenProperty codegenProperty = fromProperty("inner", inner);
codegenParameter.items = codegenProperty;
codegenParameter.baseType = codegenProperty.datatype;
codegenParameter.isContainer = true;
codegenParameter.isListContainer = true;
codegenParameter.description = s.getDescription();
// recursively add import
while (codegenProperty != null) {
imports.add(codegenProperty.baseType);
codegenProperty = codegenProperty.items;
}
} else if (ModelUtils.isMapSchema(s)) {
LOGGER.error("Map of form parameters not supported. Please report the issue to https://github.com/openapitools/openapi-generator if you need help.");
continue;
} else {
codegenParameter = fromFormProperty(entry.getKey(), entry.getValue(), imports);
}
// Set 'required' flag defined in the schema element
if (!codegenParameter.required && schema.getRequired() != null) {

View File

@ -476,8 +476,16 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
}
@Override
public String toDefaultValue(Schema prop) {
// nil
public String toDefaultValue(Schema p) {
if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) {
if (p.getDefault() != null) {
return p.getDefault().toString();
}
} else if (ModelUtils.isStringSchema(p)) {
if (p.getDefault() != null) {
return "\"" + escapeText((String) p.getDefault()) + "\"";
}
}
return null;
}
@ -621,7 +629,12 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
@Override
public String toEnumValue(String value, String datatype) {
return String.valueOf(value);
// for string, array of string
if ("String".equals(datatype) || "[String]".equals(datatype) || "[String:String]".equals(datatype)) {
return "\"" + String.valueOf(value) + "\"";
} else {
return String.valueOf(value);
}
}
@Override

View File

@ -23,8 +23,12 @@ open class {{classname}} {
/**
* enum for parameter {{paramName}}
*/
public enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} { {{#allowableValues}}{{#enumVars}}
case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}}
public enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} {
{{#allowableValues}}
{{#enumVars}}
case {{name}} = {{{value}}}
{{/enumVars}}
{{/allowableValues}}
}
{{/isEnum}}

View File

@ -1,4 +1,7 @@
public enum {{classname}}: {{dataType}}, Codable {
{{#allowableValues}}{{#enumVars}} case {{name}} = "{{{value}}}"
{{/enumVars}}{{/allowableValues}}
{{#allowableValues}}
{{#enumVars}}
case {{name}} = {{{value}}}
{{/enumVars}}
{{/allowableValues}}
}

View File

@ -1,3 +1,7 @@
public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { {{#allowableValues}}{{#enumVars}}
case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}}
public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable {
{{#allowableValues}}
{{#enumVars}}
case {{name}} = {{{value}}}
{{/enumVars}}
{{/allowableValues}}
}

View File

@ -1,7 +1,7 @@
// APIHelper.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,7 +1,7 @@
// APIs.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// AnotherFakeAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -28,6 +28,9 @@ open class AnotherFakeAPI {
To test special tags
- PATCH /another-fake/dummy
- To test special tags
- examples: [{contentType=application/json, example={
"client" : "client"
}}]
- parameter client: (body) client model
- returns: RequestBuilder<Client>
*/

View File

@ -1,8 +1,8 @@
//
// FakeAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -26,6 +26,7 @@ open class FakeAPI {
/**
- POST /fake/outer/boolean
- Test serialization of outer boolean types
- examples: [{contentType=*/*, example=null}]
- parameter body: (body) Input boolean as post body (optional)
- returns: RequestBuilder<Bool>
*/
@ -56,6 +57,7 @@ open class FakeAPI {
/**
- POST /fake/outer/composite
- Test serialization of object with outer number type
- examples: [{contentType=*/*, example={ }}]
- parameter outerComposite: (body) Input composite as post body (optional)
- returns: RequestBuilder<OuterComposite>
*/
@ -86,6 +88,7 @@ open class FakeAPI {
/**
- POST /fake/outer/number
- Test serialization of outer number types
- examples: [{contentType=*/*, example=null}]
- parameter body: (body) Input number as post body (optional)
- returns: RequestBuilder<Double>
*/
@ -116,6 +119,7 @@ open class FakeAPI {
/**
- POST /fake/outer/string
- Test serialization of outer string types
- examples: [{contentType=*/*, example=null}]
- parameter body: (body) Input string as post body (optional)
- returns: RequestBuilder<String>
*/
@ -186,6 +190,9 @@ open class FakeAPI {
To test \"client\" model
- PATCH /fake
- To test \"client\" model
- examples: [{contentType=application/json, example={
"client" : "client"
}}]
- parameter client: (body) client model
- returns: RequestBuilder<Client>
*/
@ -337,9 +344,9 @@ open class FakeAPI {
/**
* enum for parameter enumFormStringArray
*/
public enum EnumFormStringArray_testEnumParameters: [String] {
case greaterThan = >
case dollar = $
public enum EnumFormStringArray_testEnumParameters: String {
case greaterThan = ">"
case dollar = "$"
}
/**
@ -355,16 +362,16 @@ open class FakeAPI {
To test enum parameters
- parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional)
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to -efg)
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg")
- parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional)
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg)
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg")
- parameter enumQueryInteger: (query) Query parameter enum test (double) (optional)
- parameter enumQueryDouble: (query) Query parameter enum test (double) (optional)
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional)
- parameter enumFormString: (form) Form parameter enum test (string) (optional)
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$")
- parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg")
- parameter completion: completion handler to receive the data and the error objects
*/
open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray]_testEnumParameters? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: String? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) {
testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in
if error == nil {
completion((), error)
@ -380,20 +387,20 @@ open class FakeAPI {
- GET /fake
- To test enum parameters
- parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional)
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to -efg)
- parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg")
- parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional)
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg)
- parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg")
- parameter enumQueryInteger: (query) Query parameter enum test (double) (optional)
- parameter enumQueryDouble: (query) Query parameter enum test (double) (optional)
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional)
- parameter enumFormString: (form) Form parameter enum test (string) (optional)
- parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$")
- parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg")
- returns: RequestBuilder<Void>
*/
open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray]_testEnumParameters? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder<Void> {
open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: String? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder<Void> {
let path = "/fake"
let URLString = PetstoreClientAPI.basePath + path
let formParams: [String:Any?] = [
"enum_form_string_array": enumFormStringArray?.rawValue,
"enum_form_string_array": enumFormStringArray,
"enum_form_string": enumFormString?.rawValue
]

View File

@ -1,8 +1,8 @@
//
// FakeClassnameTags123API.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -31,6 +31,9 @@ open class FakeClassnameTags123API {
- API Key:
- type: apiKey api_key_query (QUERY)
- name: api_key_query
- examples: [{contentType=application/json, example={
"client" : "client"
}}]
- parameter client: (body) client model
- returns: RequestBuilder<Client>
*/

View File

@ -1,8 +1,8 @@
//
// PetAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -125,6 +125,32 @@ open class PetAPI {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}}, {contentType=application/xml, example=<Pet>
<id>123456789</id>
<name>doggie</name>
<photoUrls>
<photoUrls>aeiou</photoUrls>
</photoUrls>
<tags>
</tags>
<status>aeiou</status>
</Pet>}]
- parameter status: (query) Status values that need to be considered for filter
- returns: RequestBuilder<[Pet]>
*/
@ -163,6 +189,32 @@ open class PetAPI {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}}, {contentType=application/xml, example=<Pet>
<id>123456789</id>
<name>doggie</name>
<photoUrls>
<photoUrls>aeiou</photoUrls>
</photoUrls>
<tags>
</tags>
<status>aeiou</status>
</Pet>}]
- parameter tags: (query) Tags to filter by
- returns: RequestBuilder<[Pet]>
*/
@ -201,6 +253,32 @@ open class PetAPI {
- API Key:
- type: apiKey api_key
- name: api_key
- examples: [{contentType=application/json, example={
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}}, {contentType=application/xml, example=<Pet>
<id>123456789</id>
<name>doggie</name>
<photoUrls>
<photoUrls>aeiou</photoUrls>
</photoUrls>
<tags>
</tags>
<status>aeiou</status>
</Pet>}]
- parameter petId: (path) ID of pet to return
- returns: RequestBuilder<Pet>
*/
@ -329,6 +407,11 @@ open class PetAPI {
- OAuth:
- type: oauth2
- name: petstore_auth
- examples: [{contentType=application/json, example={
"code" : 0,
"type" : "type",
"message" : "message"
}}]
- parameter petId: (path) ID of pet to update
- parameter additionalMetadata: (form) Additional data to pass to server (optional)
- parameter file: (form) file to upload (optional)

View File

@ -1,8 +1,8 @@
//
// StoreAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -100,6 +100,21 @@ open class StoreAPI {
Find purchase order by ID
- GET /store/order/{order_id}
- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- examples: [{contentType=application/json, example={
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"
}}, {contentType=application/xml, example=<Order>
<id>123456789</id>
<petId>123456789</petId>
<quantity>123</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>aeiou</status>
<complete>true</complete>
</Order>}]
- parameter orderId: (path) ID of pet that needs to be fetched
- returns: RequestBuilder<Order>
*/
@ -134,6 +149,21 @@ open class StoreAPI {
/**
Place an order for a pet
- POST /store/order
- examples: [{contentType=application/json, example={
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"
}}, {contentType=application/xml, example=<Order>
<id>123456789</id>
<petId>123456789</petId>
<quantity>123</quantity>
<shipDate>2000-01-23T04:56:07.000Z</shipDate>
<status>aeiou</status>
<complete>true</complete>
</Order>}]
- parameter order: (body) order placed for purchasing the pet
- returns: RequestBuilder<Order>
*/

View File

@ -1,8 +1,8 @@
//
// UserAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -172,6 +172,25 @@ open class UserAPI {
/**
Get user by user name
- GET /user/{username}
- examples: [{contentType=application/json, example={
"firstName" : "firstName",
"lastName" : "lastName",
"password" : "password",
"userStatus" : 6,
"phone" : "phone",
"id" : 0,
"email" : "email",
"username" : "username"
}}, {contentType=application/xml, example=<User>
<id>123456789</id>
<username>aeiou</username>
<firstName>aeiou</firstName>
<lastName>aeiou</lastName>
<email>aeiou</email>
<password>aeiou</password>
<phone>aeiou</phone>
<userStatus>123</userStatus>
</User>}]
- parameter username: (path) The name that needs to be fetched. Use user1 for testing.
- returns: RequestBuilder<User>
*/

View File

@ -1,7 +1,7 @@
// AlamofireImplementations.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// CodableHelper.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,7 +1,7 @@
// Configuration.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,7 +1,7 @@
// Extensions.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// JSONDataEncoding.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// JSONEncodingHelper.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,7 +1,7 @@
// Models.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// AdditionalPropertiesClass.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Animal.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -12,7 +12,7 @@ import Foundation
public struct Animal: Codable {
public var className: String
public var color: String?
public var color: String? = "red"
public init(className: String, color: String?) {
self.className = className

View File

@ -1,8 +1,8 @@
//
// AnimalFarm.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ApiResponse.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ArrayOfArrayOfNumberOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ArrayOfNumberOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ArrayTest.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Capitalization.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Cat.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -12,7 +12,7 @@ import Foundation
public struct Cat: Codable {
public var className: String
public var color: String?
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String?, declawed: Bool?) {

View File

@ -1,8 +1,8 @@
//
// Category.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ClassModel.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Client.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Dog.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -12,7 +12,7 @@ import Foundation
public struct Dog: Codable {
public var className: String
public var color: String?
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String?, breed: String?) {

View File

@ -1,8 +1,8 @@
//
// EnumArrays.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// EnumClass.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -12,5 +12,4 @@ public enum EnumClass: String, Codable {
case abc = "_abc"
case efg = "-efg"
case xyz = "(xyz)"
}

View File

@ -1,8 +1,8 @@
//
// EnumTest.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// FormatTest.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// HasOnlyReadOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// List.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// MapTest.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// MixedPropertiesAndAdditionalPropertiesClass.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Model200Response.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Name.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// NumberOnly.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Order.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -22,7 +22,7 @@ public struct Order: Codable {
public var shipDate: Date?
/** Order Status */
public var status: Status?
public var complete: Bool?
public var complete: Bool? = false
public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) {
self._id = _id

View File

@ -1,8 +1,8 @@
//
// OuterComposite.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// OuterEnum.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
@ -12,5 +12,4 @@ public enum OuterEnum: String, Codable {
case placed = "placed"
case approved = "approved"
case delivered = "delivered"
}

View File

@ -1,8 +1,8 @@
//
// Pet.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// ReadOnlyFirst.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Return.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// SpecialModelName.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// Tag.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,8 +1,8 @@
//
// User.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation

View File

@ -1,7 +1,7 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
git_user_id=$1
git_repo_id=$2