Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Replace schema package #335

Closed
markbates opened this issue Mar 27, 2017 · 5 comments
Closed

Replace schema package #335

markbates opened this issue Mar 27, 2017 · 5 comments
Assignees
Milestone

Comments

@markbates
Copy link
Member

We have been using http://www.gorillatoolkit.org/pkg/schema for the binding of HTML forms to models, however, I have run into issues using it. For example, it doesn't allow for the binding of maps to a field.

During my travels I found the following package which looks quite promising and seems to do all we need it to do:
https://github.com/monoculum/formam

This is everyone's chance to weigh in on this change.

@markbates markbates added this to the 0.8.1 milestone Mar 27, 2017
@markbates markbates modified the milestones: 0.8.2, 0.8.1 Apr 11, 2017
@markbates markbates modified the milestones: 0.8.2, 0.9.0 Apr 28, 2017
@paganotoni
Copy link
Member

@markbates are you working on this one ? (looking for something for my next week :) )

@markbates
Copy link
Member Author

I started on it ages ago, but never finished. I'll push my branch this weekend for you.

@markbates
Copy link
Member Author

@apaganobeleno i thought i had a branch, but it doesn't appear i do. sorry. i do have some code from an app that is use formam/buffalo.

hopefully that will help a bit.

	buffalo.RegisterBinder("application/x-www-form-urlencoded", func(req *http.Request, i interface{}) error {
		err := req.ParseForm()
		if err != nil {
			return errors.WithStack(err)
		}
		dec := formam.NewDecoder(&formam.DecoderOptions{TagName: "formam"})
		if err := dec.Decode(req.Form, i); err != nil {
			return errors.WithStack(err)
		}
		return nil
	})

@paganotoni paganotoni self-assigned this May 27, 2017
@paganotoni
Copy link
Member

@markbates oh yes, this is at least half of the work :), i'll keep you posted.

@paganotoni
Copy link
Member

@markbates i think we're all set on this one, right ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants