forked from loafle/openapi-generator-original
This is required in some languages like Obj-C where there is no automatic value boxing and
handling of primitive types require extra work compared to non-primitive types.
Case in point: BOOL type. To assign BOOL into a dictionary, one needs to box it into an
(NSValue *) instance, so to build a dictionary for sending form data, for example, you
cannot do this in the template:
dict["{{paramName}}"] = {{paramName}};
Because if the parameter ends up being of type BOOL, an error about boxing values will be
generated:
BOOL boolValue = NO;
dict["boolValue"] = boolValue;
^---------------- Cannot do the assignment here.
The fix is to wrap it in @() like so:
BOOL boolValue = NO;
dict["boolValue"] = @(boolValue);
So a flag is needed in CodegenParameter so we can selectively emit the right boxing or
non-boxing assignment in the templates.