Skip to content

Commit

Permalink
feat(docs): document ProblemControls fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ConsoleTVs committed Nov 24, 2024
1 parent a3d8140 commit ccc1c72
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions problem.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,29 @@ type Problem struct {
type ProblemControlsResolver[R any] func(problem Problem, request *http.Request) R

type ProblemControls struct {
Lowercase ProblemControlsResolver[bool]
DefaultStatus ProblemControlsResolver[int]
DefaultType ProblemControlsResolver[string]
DefaultTitle ProblemControlsResolver[string]
// Lowercase determines if the problem controls
// should lowercase the errors found.
Lowercase ProblemControlsResolver[bool]

// DefaultStatus determines the default status code of a [Problem]
// in case it does not have one defined.
DefaultStatus ProblemControlsResolver[int]

// DefaultType determines the default type of a [Problem]
// in case it does not have one defined.
DefaultType ProblemControlsResolver[string]

// DefaultTitle determines the default title of a [Problem]
// in case it does not have one defined.
DefaultTitle ProblemControlsResolver[string]

// DefaultInstance determines the default instance of a [Problem]
// in case it does not have one defined.
DefaultInstance ProblemControlsResolver[string]
Response ProblemControlsResolver[Builder]

// Response allows customizing the actual Builder response
// that a [Problem] should be resolved to.
Response ProblemControlsResolver[Builder]
}

// ProblemsKey is the context key where the
Expand Down

0 comments on commit ccc1c72

Please sign in to comment.