()
| 919 | } |
| 920 | |
| 921 | func (p *TSimpleJSONProtocol) ParseStringBody() (string, error) { |
| 922 | line, err := p.reader.ReadString(JSON_QUOTE) |
| 923 | if err != nil { |
| 924 | return "", NewTProtocolException(err) |
| 925 | } |
| 926 | if endsWithoutEscapedQuote(line) { |
| 927 | v, ok := jsonUnquote(string(JSON_QUOTE) + line) |
| 928 | if !ok { |
| 929 | return "", NewTProtocolException(err) |
| 930 | } |
| 931 | return v, nil |
| 932 | } |
| 933 | s, err := p.ParseQuotedStringBody() |
| 934 | if err != nil { |
| 935 | return "", NewTProtocolException(err) |
| 936 | } |
| 937 | str := string(JSON_QUOTE) + line + s |
| 938 | v, ok := jsonUnquote(str) |
| 939 | if !ok { |
| 940 | e := fmt.Errorf("Unable to parse as JSON string %s", str) |
| 941 | return "", NewTProtocolExceptionWithType(INVALID_DATA, e) |
| 942 | } |
| 943 | return v, nil |
| 944 | } |
| 945 | |
| 946 | func (p *TSimpleJSONProtocol) ParseQuotedStringBody() (string, error) { |
| 947 | var sb strings.Builder |
no test coverage detected