RecognizingDecoder didn't handle ambiguous input

YAML is not guaranteed to be recognizable, so we need to bump JSON and
protobuf above it in the decoding order. Add a unit test.
This commit is contained in:
Clayton Coleman
2016-04-23 14:54:54 -04:00
parent 7e1089bb75
commit 4ad5565c41
4 changed files with 101 additions and 36 deletions

View File

@@ -419,12 +419,6 @@ func (s *RawSerializer) EncodeToStream(obj runtime.Object, w io.Writer, override
}
}
// RecognizesData implements the RecognizingDecoder interface - objects encoded with this serializer
// have no innate identifying information and so cannot be recognized.
func (s *RawSerializer) RecognizesData(peek io.Reader) (bool, error) {
return false, nil
}
var LengthDelimitedFramer = lengthDelimitedFramer{}
type lengthDelimitedFramer struct{}