Skip to content

Commit 4626737

Browse files
committed
Add note to document
1 parent 08b1e77 commit 4626737

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

functions/src/Internal/FunctionsSerializer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ private static object WrapBytes(byte[] value)
134134

135135
/// <summary>
136136
/// Deserializes a parsed JSON string from the Cloud Functions callable protocol.
137-
/// Unwraps the `{"data": ...}` or `{"result": ...}` payload and handles parsing
138-
/// standard error formats into FunctionsException if present.
137+
/// It first checks if the response contains an error, converting it into a
138+
/// <see cref="FunctionsException"/>. Otherwise, it unwraps the `{"data": ...}`
139+
/// or `{"result": ...}` payload.
139140
/// </summary>
140141
internal static object Deserialize(string data)
141142
{
@@ -175,8 +176,10 @@ internal static object Deserialize(string data)
175176
}
176177

177178
/// <summary>
178-
/// Deserializes a parsed JSON string from a Server-Sent Event (SSE) line
179-
/// into a StreamResponse (either Message or Result) or throws a FunctionsException.
179+
/// Deserializes a parsed JSON string from a Server-Sent Event (SSE) line.
180+
/// It first checks if the response contains an error, converting it into a
181+
/// <see cref="FunctionsException"/>. Otherwise, it converts it into a
182+
/// <see cref="StreamResponse"/> (either Message or Result).
180183
/// </summary>
181184
internal static StreamResponse DeserializeStreamResponse(string jsonText)
182185
{

functions/testapp/functions/functions/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ async function* generateText() {
7979
}
8080
};
8181

82-
// A streaming callable function that streams the elements of `streamData`
83-
// ("hello", "world", "this", "is", "cool") chunk by chunk when the client accepts
84-
// streaming, and returns the joined string "hello world this is cool" as the final response.
82+
/**
83+
* A streaming callable function that streams the elements of `streamData`
84+
* ("hello", "world", "this", "is", "cool") chunk by chunk when the client accepts
85+
* streaming, and returns the joined string "hello world this is cool" as the final response.
86+
*/
8587
exports.genStream = functionsV2.https.onCall(
8688
async (request, response) => {
8789
if (request.acceptsStreaming) {

0 commit comments

Comments
 (0)