Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: protojson to use DiscardUnknown option for backwards compatibility #1453

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ require (
github.com/testcontainers/testcontainers-go v0.19.0
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/xo/dburl v0.13.0
go.flipt.io/flipt/errors v1.19.2
go.flipt.io/flipt/rpc/flipt v1.19.2
go.flipt.io/flipt/errors v1.19.3
go.flipt.io/flipt/rpc/flipt v1.19.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/exporters/jaeger v1.14.0
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/protoc-gen-go-flipt-sdk/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func generateHTTPMethod(g *protogen.GeneratedFile, m mappings, method *protogen.
return
}

g.P("if err := ", protojson("Unmarshal"), "(respData, &output); err != nil { return nil, err }")
g.P("if err := (", protojson("UnmarshalOptions"), "{DiscardUnknown: true}).Unmarshal", "(respData, &output); err != nil { return nil, err }")
g.P("return &output, nil")
g.P("}\n")
}
Expand Down
20 changes: 10 additions & 10 deletions sdk/go/http/auth.sdk.gen.go

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

54 changes: 27 additions & 27 deletions sdk/go/http/flipt.sdk.gen.go

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