{"id":17270400,"url":"https://github.com/ilgooz/formutils","last_synced_at":"2025-07-10T15:42:33.787Z","repository":{"id":81479995,"uuid":"43407135","full_name":"ilgooz/formutils","owner":"ilgooz","description":"gorilla/schema \u0026 go-playground/validator","archived":false,"fork":false,"pushed_at":"2015-10-15T07:03:24.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:13:38.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://godoc.org/github.com/ilgooz/formutils","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilgooz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-30T02:30:57.000Z","updated_at":"2015-09-30T16:38:29.000Z","dependencies_parsed_at":"2023-03-08T15:45:44.792Z","dependency_job_id":null,"html_url":"https://github.com/ilgooz/formutils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ilgooz/formutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilgooz%2Fformutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilgooz%2Fformutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilgooz%2Fformutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilgooz%2Fformutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilgooz","download_url":"https://codeload.github.com/ilgooz/formutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilgooz%2Fformutils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264599812,"owners_count":23635314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T08:19:33.280Z","updated_at":"2025-07-10T15:42:33.718Z","avatar_url":"https://github.com/ilgooz.png","language":"Go","readme":"### formutils [![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](http://godoc.org/github.com/ilgooz/formutils)\n\u003e Parse \u0026 validate your *http.Request.Form by using gorilla/schema \u0026 go-playground/validator then response your invalid fields with a pretty formated JSON error message optionally\n\n## Example\n```go\nfunc CreateUserHandler(w http.ResponseWriter, r *http.Request) {\n  fields := createUserForm{}\n\n\t// parse \u0026 validate your form and response errors with a pretty json error message\n\t// if not all fields are valid\n\t// e.g.\n\t//\n\t// HTTP 400\n\t// {\n\t// \"message\": \"Invalid Data\",\n\t//   \"fields\": {\n\t//     \"email\": \"must be a valid email address\",\n\t//     \"password\": \"must be min 3 chars length\"\n\t//   }\n\t// }\n\tif formutils.ParseSend(w, r, \u0026fields) {\n\t\t// oh! some fields are not valid, exit your handler\n\t\treturn\n\t}\n\n\t// OR use formutils.Parse(r, \u0026fields) instead if you don't want to response\n\t// with an error message automatically.\n\t// Handle your invalids manually\n\t// invalids, err := formutils.Parse(r, \u0026fields)\n\n\t// everything is OK, fields should be filled with their values\n\tfmt.Println(fields)\n}\n\ntype createUserForm struct {\n\tName     string `schema:\"name\"`\n\tEmail    string `schema:\"email\" validate:\"email,required\"`\n\tPassword string `schema:\"password\" validate:\"min=3,required\"`\n}\n```\n\n[Stack](http://github.com/ilgooz/stack) *a simple idiomatic RESTful API* also uses formutils.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filgooz%2Fformutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filgooz%2Fformutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filgooz%2Fformutils/lists"}