Skip to content

Commit

Permalink
[v3-Maintenance]-Consolidate-and-Document-Core-Changes-in-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Apr 17, 2024
1 parent 96f83a5 commit 7b2c8d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions docs/core/api/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,6 @@ app.Get("/", func(c fiber.Ctx) error {

### URI

:::caution

Not finished yet.

:::

This method is similar to [Body-Binding](#body), but for path parameters. It is important to use the struct tag "uri". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of uri:"pass"

```go title="Signature"
Expand Down Expand Up @@ -555,7 +549,7 @@ Validation is also possible with the binding methods. You can specify your valid

Specify your struct validator in the [config](./fiber.md#config)

Setup your validator in the config
Setup your validator in the config:

```go title="Example"
import "github.com/go-playground/validator/v10"
Expand All @@ -575,6 +569,8 @@ app := fiber.New(fiber.Config{
})
```

Usage of the validation in the binding methods:

```go title="Example"
type Person struct {
Name string `json:"name" validate:"required"`
Expand All @@ -589,3 +585,6 @@ app.Post("/", func(c fiber.Ctx) error {
}
})
```



13 changes: 6 additions & 7 deletions versioned_docs/version-v3.x/api/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,6 @@ app.Get("/", func(c fiber.Ctx) error {

### URI

:::caution

Not finished yet.

:::

This method is similar to [Body-Binding](#body), but for path parameters. It is important to use the struct tag "uri". For example, if you want to parse a path parameter with a field called Pass, you would use a struct field of uri:"pass"

```go title="Signature"
Expand Down Expand Up @@ -555,7 +549,7 @@ Validation is also possible with the binding methods. You can specify your valid

Specify your struct validator in the [config](./fiber.md#config)

Setup your validator in the config
Setup your validator in the config:

```go title="Example"
import "github.com/go-playground/validator/v10"
Expand All @@ -575,6 +569,8 @@ app := fiber.New(fiber.Config{
})
```

Usage of the validation in the binding methods:

```go title="Example"
type Person struct {
Name string `json:"name" validate:"required"`
Expand All @@ -589,3 +585,6 @@ app.Post("/", func(c fiber.Ctx) error {
}
})
```



0 comments on commit 7b2c8d6

Please sign in to comment.