Skip to content

Commit 91bec86

Browse files
authoredFeb 17, 2025··
Merge pull request #1602 from microsoft/fix/byte_array_signature
fix: SerializationWriter.writeByteArrayValue should accept a null value
2 parents 0a2edd2 + e895a13 commit 91bec86

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed
 

‎packages/abstractions/src/serialization/serializationWriter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface SerializationWriter {
1919
* @param key the key to write the value with.
2020
* @param value the value to write to the stream.
2121
*/
22-
writeByteArrayValue(key?: string, value?: ArrayBuffer): void;
22+
writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void;
2323
/**
2424
* Writes the specified string value to the stream with an optional given key.
2525
* @param key the key to write the value with.

‎packages/serialization/json/src/jsonSerializationWriter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { DateOnly, Duration, type Guid, isUntypedNode, type ModelSerializerFunction, type Parsable, type SerializationWriter, TimeOnly, type UntypedNode, isUntypedBoolean, isUntypedString, isUntypedNull, isUntypedNumber, isUntypedObject, isUntypedArray, inNodeEnv } from "@microsoft/kiota-abstractions";
1010

1111
export class JsonSerializationWriter implements SerializationWriter {
12-
public writeByteArrayValue(key?: string, value?: ArrayBuffer): void {
12+
public writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void {
1313
if (!value) {
1414
throw new Error("value cannot be undefined");
1515
}

‎packages/serialization/multipart/src/multipartSerializationWriter.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import { type DateOnly, type Duration, type Guid, MultipartBody, type Parsable,
1010

1111
/** Serialization writer for multipart/form-data */
1212
export class MultipartSerializationWriter implements SerializationWriter {
13-
public writeByteArrayValue(
14-
key?: string,
15-
16-
value?: ArrayBuffer,
17-
): void {
13+
public writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void {
1814
if (!value) {
1915
throw new Error("value cannot be undefined");
2016
}

0 commit comments

Comments
 (0)
Please sign in to comment.