You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generation of the Swift-3 client produces wrong code, when it comes to generating a call that has a parameter which is of integer (or more generally raw-type).
/users/cards:
delete:
description: Delete a card from a userproduces:
- application/jsonparameters:
- in: bodyname: cardSlotdescription: the card that will be deletedrequired: trueschema:
type: integerformat: int32responses:
'200':
description: Success
DefaultAPI.swift:openclassfunc usersCardsDeleteWithRequestBuilder(cardSlot:Int32)->RequestBuilder<Void>{letpath="/users/cards"letURLString=SwaggerClientAPI.basePath + path
letparameters= cardSlot.encodeToJSON()as?[String:AnyObject]//-> this will fail and result in nil because of:Extensions.swift:extensionInt32:JSONEncodable{func encodeToJSON()->Any{returnNSNumber(value:selfasInt32)}}
why should the parameter be always a dictionary?
As a workaround, I will change my yaml, to contain an object.. but I think the above case should be supported as well.
The text was updated successfully, but these errors were encountered:
Description
The generation of the Swift-3 client produces wrong code, when it comes to generating a call that has a parameter which is of integer (or more generally raw-type).
Swagger-codegen version
reproduced with both
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
#5639
#5480
Suggest a fix/enhancement
Generated code looks like this:
why should the parameter be always a dictionary?
As a workaround, I will change my yaml, to contain an object.. but I think the above case should be supported as well.
The text was updated successfully, but these errors were encountered: