Skip to content

Commit 0fcf813

Browse files
authored
fix: Remove DisallowUnknownFields from Source plugin server (#277)
See cloudquery/cloudquery#2612 for an explanation. Notes: - We weren't using `DisallowUnknownFields` on the destination plugin side - We don't currently have a mechanism to warn about unknown fields, but we are working on it #272 - This will unfortunately not fix plugins that have already been released. Our next CLI release that adds new fields will have to be breaking, but after that they can be backwards-compatible.
1 parent 970f9d9 commit 0fcf813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/servers/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (s *SourceServer) Sync(req *pb.Sync_Request, stream pb.Source_SyncServer) e
6161
var spec specs.Source
6262
dec := json.NewDecoder(bytes.NewReader(req.Spec))
6363
dec.UseNumber()
64-
dec.DisallowUnknownFields()
64+
// TODO: warn about unknown fields
6565
if err := dec.Decode(&spec); err != nil {
6666
return status.Errorf(codes.InvalidArgument, "failed to decode spec: %v", err)
6767
}

0 commit comments

Comments
 (0)