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

PureJSON still escapes output #1953

Open
thetzel opened this issue Jun 17, 2019 · 0 comments
Open

PureJSON still escapes output #1953

thetzel opened this issue Jun 17, 2019 · 0 comments

Comments

@thetzel
Copy link

thetzel commented Jun 17, 2019

  • go version:
    go1.12.6

  • gin version (or commit ref):
    1.4.0

  • operating system:
    Mac + Linux

Description

Trying to use PureJSON as described in the example works fine, but when using it in my app to format a database (sqlx + sqlite) response, it will always use the default JSON behaviour of escaping the e.g. "<" in HTML as \u003c.

Working as expected:

		c.PureJSON(200, gin.H{
			"html": "<b>Hello, world!</b>",
		})

Not working:

		data := struct {
			Thing model.Thing
		}{
			thing,
		}
		c.PureJSON(200, data)

Where thing is the scanned result of a sqlx db.Get

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

No branches or pull requests

1 participant