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

bugfix type error in multipart-form payload #1863

Merged
merged 4 commits into from Sep 27, 2018
Merged

Conversation

aya-eiya
Copy link
Contributor

bugfix for #1862

type errors occur when set MultipartForm flag

Copy link
Member

@raphael raphael left a comment

Choose a reason for hiding this comment

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

Thank you for the detailed report and the great PR! I left a couple of comments that would be good to address. Thanks again.

case design.NumberKind:
return "ParseFloat"
}
panic("undefined strconv function")

This comment was marked as off-topic.

@@ -451,6 +456,34 @@ func arrayAttribute(a *design.AttributeDefinition) *design.AttributeDefinition {
return a.Type.(*design.Array).ElemType
}

func valueTypeOf(pr string, att *design.AttributeDefinition) string {

This comment was marked as off-topic.

Copy link
Contributor Author

@aya-eiya aya-eiya left a comment

Choose a reason for hiding this comment

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

@raphael
I fixed the codes according to your comments. please review.
thank you.

return varName + ", (error)(nil)"
case design.ArrayKind:
case design.HashKind:
return valueTypeOf("", att) + "{}, (error)(nil)"

This comment was marked as off-topic.

return varName + ", (error)(nil)"
case design.ArrayKind:
case design.HashKind:
return valueTypeOf("", att) + "{}, (error)(nil)"

This comment was marked as off-topic.

case design.HashKind:
return valueTypeOf("", att) + "{}, (error)(nil)"
}
return "(" + valueTypeOf("", att) + ")(nil), (error)(nil)"

This comment was marked as off-topic.

@raphael
Copy link
Member

raphael commented Sep 27, 2018

Thank you, definitely an improvement compared to the original code!

@raphael raphael merged commit 3402d49 into goadesign:v1 Sep 27, 2018
@raphael
Copy link
Member

raphael commented Sep 27, 2018

One last request please, could you port this fix to master as well? (cherry-pick the merge commit).

aya-eiya added a commit to aya-eiya/goa that referenced this pull request Sep 28, 2018
* bugfix type error in multipart-form payload

* bugfix Array attribute error in multipartform

* fix wrong comment line and add comment to new function

* fix fromString func to do not cause panic and support some other types for array element
@aya-eiya
Copy link
Contributor Author

@raphael
I send a PR for master branch.
thank you.

raphael pushed a commit that referenced this pull request Sep 28, 2018
* bugfix type error in multipart-form payload

* bugfix Array attribute error in multipartform

* fix wrong comment line and add comment to new function

* fix fromString func to do not cause panic and support some other types for array element
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.

None yet

2 participants