Skip to content

Conversation

@Jarch09
Copy link

@Jarch09 Jarch09 commented Sep 10, 2022

This adds the ability to directly render protobufs as JSON and bind to / unmarshal JSON payloads as protobufs.

Adds:

func (c *Context) ProtoJSON(code int, obj any) {
	c.Render(code, render.ProtoJSON{Data: obj})
}

func (c *Context) ShouldBindProtoJSON(obj any) error {
	return c.ShouldBindWith(obj, binding.ProtoJSON)
}

We need these new methods, because standard JSON encoding doesn't work with protobufs.

@Jarch09 Jarch09 changed the title Add proto json rendering / binging Add proto json rendering / binding Sep 10, 2022
@Jarch09
Copy link
Author

Jarch09 commented Oct 11, 2022

@appleboy @kszafran - this seems like a quick win that doesn't break other stuff. Can you please give this a quick review?

@appleboy
Copy link
Member

I will take it.

@Jarch09
Copy link
Author

Jarch09 commented Oct 20, 2022

@appleboy - any chance you can review this? Should be pretty painless ;-)

@Jarch09
Copy link
Author

Jarch09 commented Dec 10, 2022

@appleboy @kszafran - this seems like a quick win that doesn't break other stuff. Can you please give this a quick review?

Heyyy sorry following up on this. Can someone please review this PR?

@kszafran
Copy link
Contributor

@Jarch09 I'm not a maintainer, I can't do anything here 😅

@Jarch09
Copy link
Author

Jarch09 commented Dec 29, 2022

@Jarch09 I'm not a maintainer, I can't do anything here 😅

Understood. @appleboy @thinkerou

@appleboy appleboy added this to the v1.9 milestone Dec 29, 2022
@thinkerou thinkerou modified the milestones: v1.9, v1.10 Jan 17, 2023
@lukaszo
Copy link

lukaszo commented Jan 18, 2023

@thinkerou @appleboy @Jarch09, can I somehow help with merging the PR?

@Jarch09
Copy link
Author

Jarch09 commented Jan 22, 2023

@thinkerou @appleboy @Jarch09, can I somehow help with merging the PR?

Would love to get this merged in... lmk what needs to be done

@appleboy appleboy modified the milestones: v1.10, v1.11 Mar 21, 2024
@appleboy appleboy modified the milestones: v1.11, v1.12 Jun 21, 2025
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.

5 participants