-
Notifications
You must be signed in to change notification settings - Fork 27
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 malformed multipart body #1423
base: main
Are you sure you want to change the base?
Conversation
…iota-typescript into fix_malformed_multipart_body
@@ -93,7 +93,7 @@ interface MultipartEntry { | |||
serializationCallback?: ModelSerializerFunction<Parsable>; | |||
} | |||
|
|||
export const serializeMultipartBody = (writer: SerializationWriter, multipartBody: Partial<MultipartBody> | undefined | null = new MultipartBody()): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert the const changes on this line. Here is more context https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/
@@ -30,51 +30,48 @@ export class MultipartSerializationWriter implements SerializationWriter { | |||
public onBeforeObjectSerialization: ((value: Parsable) => void) | undefined; | |||
public onAfterObjectSerialization: ((value: Parsable) => void) | undefined; | |||
public onStartObjectSerialization: ((value: Parsable, writer: SerializationWriter) => void) | undefined; | |||
public writeStringValue = (key?: string, value?: string | null): void => { | |||
public writeStringValue = (key?: string, value?: string): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert the removal of null here as it does not conform with the interface
} | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
public writeBooleanValue = (key?: string, value?: boolean | null): void => { | ||
public writeBooleanValue = (key?: string, value?: boolean): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about the null option for all the following methods
if (first) { | ||
first = false; | ||
} else { | ||
writer.writeStringValue(undefined, ""); | ||
writer.writeStringValue(undefined, "\r\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a unit test to prevent future regressions?
Opened to replace #1069 which seems to be from a fork I can't access
Fixes #1068