Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: SerializationWriter.writeByteArrayValue should accept a null value #1602

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface SerializationWriter {
* @param key the key to write the value with.
* @param value the value to write to the stream.
*/
writeByteArrayValue(key?: string, value?: ArrayBuffer): void;
writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void;
/**
* Writes the specified string value to the stream with an optional given key.
* @param key the key to write the value with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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";

export class JsonSerializationWriter implements SerializationWriter {
public writeByteArrayValue(key?: string, value?: ArrayBuffer): void {
public writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void {
if (!value) {
throw new Error("value cannot be undefined");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { type DateOnly, type Duration, type Guid, MultipartBody, type Parsable,

/** Serialization writer for multipart/form-data */
export class MultipartSerializationWriter implements SerializationWriter {
public writeByteArrayValue(
key?: string,

value?: ArrayBuffer,
): void {
public writeByteArrayValue(key?: string, value?: ArrayBuffer | null): void {
if (!value) {
throw new Error("value cannot be undefined");
}
Expand Down
Loading