-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow base64 content for create/update file #1488
Allow base64 content for create/update file #1488
Conversation
@@ -106,7 +106,7 @@ public class CreateFileRequest : ContentRequest | |||
/// Creates an instance of a <see cref="CreateFileRequest" />. | |||
/// </summary> | |||
/// <param name="message">The message.</param> | |||
/// <param name="content">The content.</param> | |||
/// <param name="content">The content encoded in base64.</param> |
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.
@ryangribble @haacked how do we feel about this breaking change? Should we instead introduce overloads?
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.
Yeah, that's a very subtle breaking change. Probably best to use an overload.
Someday I'd like to write a Base64Content
type. 😄 rather than using strings for everything.
+1 on not making a breaking change The overload approach you've gone with seems ok to me 👍 |
Sorry for the delay @laedit This LGTM and the integration tests are 👌 plus the revisions make it a non breaking change 😀 |
@ryangribble No problem, thanks for the merge 😄 |
Fixes #1143.
Since 1.0 has not been reached yet, I made the fix minimal and as I think the method should have been originally, but there is a breaking change.
If you want to mitigate the breaking change I propose three ways:
Content
contains base64 content. Breaking change onContent.Get()
. Could add corresponding ctors with bool if convert to base64.Base64CreateFileRequest
with a virtualContent
property wich contains base64 content.CreateFileRequest
overrides it and provides decoded content.SerializeIgnore
andSerializeName
attributes, add first onContent
and second on new propertyBase64Content
. When set,Content
convert value to base64 and setBase64Content
.