Skip to content

Commit

Permalink
Release v1.29.2 (#545)
Browse files Browse the repository at this point in the history
Contains the following fix:
streaming: Handle unrecognized fields and non-matching field types (#544)
  • Loading branch information
witriew committed Sep 9, 2021
2 parents 58a0fa2 + 9baa107 commit ceb8018
Show file tree
Hide file tree
Showing 24 changed files with 1,732 additions and 1,736 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.29.2] - 2021-09-09
### Fixed
- Streaming now handles unrecongized fields and non-matching field types when
deserializing Thrift structs.

## [1.29.1] - 2021-08-31
### Fixed
- Streaming encodes now handle `nil` items properly in containers.
Expand Down Expand Up @@ -422,6 +427,7 @@ this release.
### Added
- Initial release.

[1.29.2]: https://github.com/thriftrw/thriftrw-go/compare/v1.29.1...v1.29.2
[1.29.1]: https://github.com/thriftrw/thriftrw-go/compare/v1.29.0...v1.29.1
[1.29.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.28.0...v1.29.0
[1.28.0]: https://github.com/thriftrw/thriftrw-go/compare/v1.27.0...v1.28.0
Expand Down
10 changes: 6 additions & 4 deletions gen/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,9 @@ func (f fieldGroupGenerator) Decode(g Generator) error {
}
for <$ok> {
switch <$fh>.ID {
switch {
<range .Fields ->
case <.ID>:
if <$fh>.Type == <typeCode .Type> {
case <$fh>.ID == <.ID> && <$fh>.Type == <typeCode .Type>:
<- $lhs := printf "%s.%s" $v (goName .) ->
<- if .Required ->
<$lhs>, err = <decode .Type $sr>
Expand All @@ -617,8 +616,11 @@ func (f fieldGroupGenerator) Decode(g Generator) error {
<if .Required ->
<$isSet.Rotate (printf "%sIsSet" .Name)> = true
<- end>
}
<end ->
default:
if err := <$sr>.Skip(<$fh>.Type); err != nil {
return err
}
}
if err := <$sr>.ReadFieldEnd(); err != nil {
Expand Down
264 changes: 131 additions & 133 deletions gen/internal/tests/collision/collision.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/internal/tests/constants/constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ceb8018

Please sign in to comment.