Skip to content

Commit

Permalink
fix: Update changelog with migration guide for form field value consu…
Browse files Browse the repository at this point in the history
…mption
  • Loading branch information
deepjyoti30-st committed Sep 27, 2024
1 parent 08844a5 commit 9803fb8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changes the type of `value` in `TypeFormField` to `interface{}` instead of `string` to add support for any type of value in form fields.

### Migration

#### Typecast value of form fields to expected type before using it

To read a value from formFields where id is `name`,

Before:

```go
// formField should be of type []epmodels.TypeFormField
var name string
for id, value := range formFields {
if id == "name" {
name = value
}
}
```

After:

```go
// formField should be of type []epmodels.TypeFormField
var name string
for id, value := ranger formFields {
if id == "name" {
nameAsStr, asStrOk := value.(string)
if !asStrOk {
// Handle the error accordingly
}
name = nameAsStr
}
}
```

## [0.24.2] - 2024-09-03

- Fixes memory leak with the JWKS cache.
Expand Down

0 comments on commit 9803fb8

Please sign in to comment.