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(go-http): http quickstart is broken #885

Merged
merged 3 commits into from
Jun 15, 2023
Merged

fix(go-http): http quickstart is broken #885

merged 3 commits into from
Jun 15, 2023

Conversation

guergabo
Copy link
Contributor

@guergabo guergabo commented Jun 14, 2023

Description

The Go HTTP quickstart for pubsub is currently broken. It tries to unmarshal the data the publisher sends into a string. It is not a string, but rather a json string of a map[string]int. I checked with other languages such as python and it seems they also expect a map so went with that. Tested and fixed my issue.

FYI: fixed bug needed to set content-type to application/json. So kinda not a bug cause was originally a string because the http default in golang seems to be text/plain. Regardless, think this is a small improvement for consistency with the other languages (others send regular json payload) and too easy of a bug introduced if they take quickstart and adapt it to there own to send json and get confused like me lol.

Before Bug Fix

Screen Shot 2023-06-14 at 10 21 39 AM

After Bug Fix 🤌

Screen Shot 2023-06-14 at 10 17 38 AM

Issue reference

Quick bug fix.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • The quickstart code compiles correctly
  • You've tested new builds of the quickstart if you changed quickstart code
  • You've updated the quickstart's README if necessary
  • If you have changed the steps for a quickstart be sure that you have updated the automated validation accordingly. All of our quickstarts have annotations that allow them to be executed automatically as code. For more information see mechanical-markdown. For user guide with examples see Examples.

…er languages seem to expect a map so went with that.

Signed-off-by: guergabo <guergabo@umich.edu>
@guergabo guergabo marked this pull request as ready for review June 14, 2023 15:12
guergabo added 2 commits June 14, 2023 14:33
Signed-off-by: guergabo <guergabo@umich.edu>
Signed-off-by: guergabo <guergabo@umich.edu>
Copy link
Contributor

@paulyuk paulyuk left a comment

Choose a reason for hiding this comment

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

LGTM - thank you for this contribution!

@paulyuk paulyuk merged commit 879f8a6 into dapr:master Jun 15, 2023
@guergabo guergabo deleted the guergabo/go-http branch June 15, 2023 14:56
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.

3 participants