forked from loafle/openapi-generator-original
Swift4: Fix issue 6746 - problem with arrays of primitives (#7072)
* Update samples using latest codegen and templates * Fix issue 6746 - problem with array models where array element type is a primitive
This commit is contained in:
@@ -11,7 +11,7 @@ import Foundation
|
||||
|
||||
/** {{description}} */{{/description}}
|
||||
{{#isArrayModel}}
|
||||
public typealias {{classname}} = [{{arrayModelType}}]
|
||||
public typealias {{classname}} = {{parent}}
|
||||
{{/isArrayModel}}
|
||||
{{^isArrayModel}}
|
||||
{{#isEnum}}
|
||||
|
||||
@@ -251,6 +251,28 @@
|
||||
},
|
||||
"description": "Example Error object"
|
||||
},
|
||||
"ModelStringArray": {
|
||||
"type": "array",
|
||||
"description": "This defines an array of strings.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"ModelDoubleArray": {
|
||||
"type": "array",
|
||||
"description": "This defines an array of doubles.",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"ModelErrorInfoArray": {
|
||||
"type": "array",
|
||||
"description": "This defines an array of ErrorInfo objects.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ErrorInfo"
|
||||
}
|
||||
},
|
||||
"VariableNameTest": {
|
||||
"description": "This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words.",
|
||||
"type": "object",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// ModelDoubleArray.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/** This defines an array of doubles. */
|
||||
public typealias ModelDoubleArray = [Double]
|
||||
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// ModelErrorInfoArray.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/** This defines an array of ErrorInfo objects. */
|
||||
public typealias ModelErrorInfoArray = [ErrorInfo]
|
||||
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// ModelStringArray.swift
|
||||
//
|
||||
// Generated by swagger-codegen
|
||||
// https://github.com/swagger-api/swagger-codegen
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/** This defines an array of strings. */
|
||||
public typealias ModelStringArray = [String]
|
||||
Reference in New Issue
Block a user