-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
/cc @ahsonkhan @bartonjs to get their opinions on this wording.
The properties Utf8JsonReader.ValueSpan and Utf8JsonReader.ValueSequence do not always contain well-formed data. For example, if the binary input to the Utf8JsonReader type contains ill-formed UTF-8 strings, the APIs will not detect this error until the caller attempts to materialize the string via the Utf8JsonReader.GetString method. If the consumer does not query this method and instead relies solely on ValueSequence / ValueSpan, there's the possibility that ill-formed UTF-8 data could make its way into the application.
This behavior is by-design. However, since it has potential security and reliability implications, it should probably be called out in the Remarks section for the ValueSequence / ValueSpan properties. If there's other validation that the Get* APIs would normally perform that are skipped by these raw property getters, that should also be called out in the same section.