Skip to content

bugfix type error in multipart-form payload#1863

Merged
raphael merged 4 commits intogoadesign:v1from
aya-eiya:master
Sep 27, 2018
Merged

bugfix type error in multipart-form payload#1863
raphael merged 4 commits intogoadesign:v1from
aya-eiya:master

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.

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.

2 participants