ChainSafe / ChainSafe/canton-middleware

feat: Implement standardized request validation

Open
#127 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1
Forks
1
Avg merge
40m
Merged PRs (30d)
1

Description

### Description

We need consistent JSON decoding and validation across API.

Use:

* `echo.Context.Bind`
* `go-playground/validator`
* field-level validation errors

---

### Scope

* Add validator setup in Echo
* Define validation struct tags
* Map validation errors to standard API error response

---

### Example

```go
type TransferRequest struct {
From string `json:"from" validate:"required"`
To string `json:"to" validate:"required"`
}
```

---

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Echo API handlers and any existing API error response handling. Review Echo Context.Bind, go-playground/validator, and the TransferRequest example to determine how validation tags and field-level errors should fit together. Done means request binding, validation, and a standard validation-error response are consistent across the API.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.