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

modify serialization to check for text plan content type #2649

Merged
merged 8 commits into from
Jun 21, 2024

Conversation

iscai-msft
Copy link
Contributor

fixes #2647

@@ -105,7 +105,7 @@ class RawDeserializer:
# Remove Byte Order Mark if present in string
data_as_str = data_as_str.lstrip(_BOM)

if content_type is None:
if content_type is None or content_type == "text/plain":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Laurent that we had better keep consistent with azure-core

@@ -2498,5 +2498,10 @@ def test_skip_url_encoding(self):
self.assertEqual("%2Fdatabase%2F%7BObject.value%7D", result2)


def test_deserialize_text():
assert "str" == RawDeserializer.deserialize_from_text("str", content_type="text/plain")
assert "str" == RawDeserializer.deserialize_from_text(b"str", content_type="text/plain")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test case to cover this scenario

@iscai-msft
Copy link
Contributor Author

thanks @msyyc

@iscai-msft iscai-msft merged commit f47202d into main Jun 21, 2024
15 checks passed
@iscai-msft iscai-msft deleted the fix_pipeline_response_deserialization branch June 21, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deserialization issue following moving to new requests and responses
3 participants