Skip to content

Fix indentation #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Jun 9, 2015
Merged

Fix indentation #847

merged 51 commits into from
Jun 9, 2015

Conversation

wing328
Copy link
Contributor

@wing328 wing328 commented Jun 9, 2015

Fixed #846

Karthik Velakur and others added 30 commits April 16, 2015 13:26
…links

Linked to the 2.0.18 tag instead of the no longer existing 2.0.17.
…links

Found the 2.0.17 tag under 2.0.17 instead of v2.0.17.
…swagger.json

Currently string "... You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or ... " gets URL encoded, resuling in Node js throwing "Unable to parse" error.

Use of {{{ }}} forces mustache to skip URL encoding
http://mustache.github.io/mustache.5.html#Partials
Fixes a bug with Node.js example generating invalid package.json and swa...
Issue swagger-api#642 - Removing the unnecesary \n added to generated example reque...
Improve README for OS X Users with random Java versions
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.
Adds isPrimitiveType flag to CodegenParameter.
fehguy added a commit that referenced this pull request Jun 9, 2015
@fehguy fehguy merged commit 3b3738e into swagger-api:develop_2.0 Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants