livebud / livebud/bud

Required controller input validation

Open
#171 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking bug
Dominant language
JavaScript
Stars
5.6k
Forks
175
PR merge metrics
No merged PRs in 30d

Description

Given the following controller/controller.go:

package controller

type Controller struct {}

type User struct {
  Name string `json:"name"`
  Email string `json:"email"`
}

func (c *Controller) Create(name, email string) (*User, error) {
  return &User{name, email}, nil
}

If you run the following request: GET /?name=Alice, you'll get back the following response:

{
  "name": "Alice",
  "email": ""
}

It should actually be a validation error, "email cannot be blank", never run the controller action and most likely return a 422.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with controller/controller.go and reproduce the GET /?name=Alice request described in the issue. Trace how controller inputs reach Create and identify the existing request-handling or validation entry point. Done means a missing email produces "email cannot be blank", returns HTTP 422, and does not run the controller action.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.