Open julienfouilhe opened 7 years ago
cc @Edubits @jaz-ah @jgavris @wing328
Edit: Tried with master, and now it appears it doesn't even create a decoder for UserInstruments
Ok so this is due to :
m.arrayModelType = fromProperty(name, arrayProperty).complexType;
But when the array is strings, in updatePropertyForArray
:
if (!languageSpecificPrimitives.contains(innerProperty.baseType)) {
property.complexType = innerProperty.baseType;
} else {
property.isPrimitiveType = true;
}
complexType
isn't set.
I don't know why this condition is there but this is in the DefaultCodegen so I don't feel like changing anything! :p
@julienfouilhe do you know if the same issue exists on latest master/2.3.0?
@jaz-ah It does on master, except that the decoder does not exist for this type anymore. Since it's an array of string I guess it's okay and it will go through the "basic" one (not sure though).
But the typealias error is still there
ok thx @julienfouilhe - did this break recently for you or is this something new - just trying to see if I can track down the history in the code.
@jaz-ah I wasn't using arrays of strings before, new models and routes in the swagger spec revealed that error. So I don't know when this was introduced or if it was always there.
ok i'll see if i can find some time this weekend to take a look unless @jgavris beats me to it.
I guess we could just change the template to get the type of the items, but I tried {{items.dataType}}
and it didn't appear to work
Actually, master/2.3.0 breaks a lot of things for me, notably this PR I submitted #5433. I'll see later if I can fix that back.
Description
Hi guys, Arrays of strings appear broken in the swift 3 client. Using the swagger declaration below, it generates the following file:
When it should be
And in the Decoders:
When it should be:
Still trying to spot the problem, but if someone that actually coded the client could have a look I would greatly appreciate it!
Thanks!
Swagger-codegen version
2.2.3
Swagger declaration file content or url
Command line used for generation
swagger-codegen generate -i https://url.com -l swift3 -o ../api-client-swift3 -c conf.json