-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Milestone
Description
Description
For Swift codegen, the CodegenOperation's defaultResponse is never set to type file, even when specified in the swagger doc, like so:
responses:
200:
description: success
schema:
type: fileThis means that anything nested in the mustache tags {{#operation}}{{#isResponseFile}} never get evaluated, even for file type responses.
Swagger-codegen version
master branch
Suggest a Fix
The fix is very simple: the function public boolean isDataTypeFile(String dataType) needs to be implemented in SwiftCodegen.java and Swift3Codegen.java. Since these methods are currently not implemented, the response type incorrectly uses the same function from DefaultCodegen.java, which looks for the type string "file" instead of the Swift equivalent "NSURL" or "URL".
I can create a pull request with the fix if you like.