[objc] Initialize default BOOL with @(YES)/@(NO). (#5982) (#5999)

This will prevent submitting integer numbers instead of booleans
when posting objects to the REST API.
This commit is contained in:
marcotta 2017-07-07 11:16:49 +02:00 committed by wing328
parent 4b9d0e6a10
commit 7ae4146a2b

View File

@ -640,9 +640,9 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
BooleanProperty dp = (BooleanProperty) p; BooleanProperty dp = (BooleanProperty) p;
if (dp.getDefault() != null) { if (dp.getDefault() != null) {
if (dp.getDefault().toString().equalsIgnoreCase("false")) if (dp.getDefault().toString().equalsIgnoreCase("false"))
return "@0"; return "@(NO)";
else else
return "@1"; return "@(YES)";
} }
} else if (p instanceof DateProperty) { } else if (p instanceof DateProperty) {
// TODO // TODO