OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-1476) JSON batch body encoding for "text" content types may cause conversion errors or data loss


Evan Ireland created ODATA-1476:
-----------------------------------

             Summary: JSON batch body encoding for "text" content types may cause conversion errors or data loss
                 Key: ODATA-1476
                 URL: https://issues.oasis-open.org/browse/ODATA-1476
             Project: OASIS Open Data Protocol (OData) TC
          Issue Type: Bug
    Affects Versions: V4.01_OS
            Reporter: Evan Ireland


OData 4.01 JSON Format Section 19.1 Batch Request states:

... "For media types of top-level type text, for example text/plain, the value of body is a string containing the value of the request body."

This is fine if there is an explicit charset=utf-8 parameter in the Content-Type, otherwise is highly problematic for two reasons:

1. See https://www.w3.org/International/articles/http-charset/index "It is very important to always label Web documents explicitly. HTTP 1.1 says that the default charset is ISO-8859-1. But there are too many unlabeled documents in other encodings, so browsers use the reader's preferred encoding when there is no explicit charset parameter."

With no explicit charset, we may assume that media/stream content is utf-8 when it isn't, and risk transmitting invalid UTF-8 sequences or failing conversions.

2. If charset is not us-ascii (a strict subset of utf-8) or utf-8, then the agent (client or server) attempting to encode a body as a JSON string may be unable (or even likely) to fail the conversion as it may not have a suitable conversion library for arbitrary charset conversion.

Contrast with multipart batches, where media/stream content (within a batch request/response) would be treated as binary with no conversion. If we cannot reliably use JSON batches for arbitrary "text" media/stream types without fear of conversion error or lossy conversion, then we will need to use multipart batches for reliable media/stream batch processing.



--
This message was sent by Atlassian Jira
(v8.3.3#803004)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]