Skip to content
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

Fix isPrimitiveType for file property #4421

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

wing328
Copy link
Contributor

@wing328 wing328 commented Dec 18, 2016

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

To fix #4420

cc @www2k

@@ -3309,7 +3309,8 @@ public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter paramete
parameter.isPrimitiveType = true;
} else if (Boolean.TRUE.equals(property.isFile)) {
parameter.isFile = true;
parameter.isPrimitiveType = true;
// file is *not* a primitive type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused with the term primitive. (I did not notice additional.)

An additional primitive data type "file" is used by the Parameter Object and the Response Object to set the parameter type or the response as being a file.

from http://swagger.io/specification/#data-types-12

To clarify, I want to know whether additional primitive data type is isPrimitiveType or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, I want to know whether additional primitive data type is isPrimitiveType or not.

@www2k we've been treating isFile as a non-primitive type (which means isPrimitiveType set to false). It's definitely arguable as you've pointed out the following:

An additional primitive data type "file" is used by the Parameter Object and the Response Object to set the parameter type or the response as being a file.

What I noticed is that some mustache values rely on isFile set to true and isPrimitiveType set to false. My take is to keep the old logic and to revise it with a valid use case in 2.3.0 branch.

Does your enhancement rely on both isFile and isPrimitiveType set to true?

@wing328 wing328 added this to the v2.2.2 milestone Dec 20, 2016
@wing328 wing328 merged commit 43ff85d into swagger-api:master Dec 20, 2016
@wing328 wing328 deleted the fix_isfile_boolean branch December 20, 2016 07:48
www2k pushed a commit to www2k/swagger-codegen that referenced this pull request Jan 2, 2017
wing328 added a commit that referenced this pull request Jan 23, 2017
* Merge branch 'www2k-feature/file-response'

* Merge pull request #4421 from wing328/fix_isfile_boolean

Fix `isPrimitiveType` for file property

* roll back to latest working version of swagger paresr for codegen

* enable typescript-angular2 to upload file

* update typescript-angular2 samples
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isFile, isPrimitiveType should not be both set to true
2 participants