[Swift3] null enumerations should not cause failure#4762
[Swift3] null enumerations should not cause failure#4762wing328 merged 4 commits intoswagger-api:2.3.0from
Conversation
success or failure on numm enumerations should be decided by users
|
Good catch, if the field is null it will return a typeMismatch, which is incorrect for decodeOptional(). But will this also return |
|
Thanks for reviewing the code. You're right, it shouldn't return success if the type mismatched. |
|
I pushed a fix. Another similar place (which is left intact) is https://github.com/swagger-api/swagger-codegen/pull/4762/files#diff-940535e66d162a893df844fd9b6b45ffL202 I don't know when this function will be called. I'm a beginner in Swift. Isn't this case already covered in the function without |
|
+1 thx for the contribution @wwwjfy |
da908c3 to
c2ac613
Compare
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
As all other the fields can be null, I think an enumeration field can also be null. The users can decide whether that's a problem. This is to be consistent with previous behaviors.
This was introduced in #4547 (@philippelatulippe)
The real change is only one line, but I cannot help but fix format issues.