Skip to content

@azure-rest/core-client_2.2.0

Compare
Choose a tag to compare
@azure-sdk azure-sdk released this 12 Jul 03:16
3888ad0
[core-client-rest] Update Serialization Check Logic (#30339)

### Describe the problem that is addressed by this PR
Currently, all request body that has content types that start with
"application/json" will be serialized by the `getRequestBody` function.
This is an issue for Schema Registry because the request body has
already been serialized and the content type also starts with
"application/json". Reordering the serialization method to check for
`Uint8Array` before checking for "application/json" would eliminate this
problem.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
- Add an option called `skipSerialization` in the internal options bag
for sending request. It'll affect the RLC experience and force the
customer to use this option to make a successful request
- Check for specific content types. It'll be limited in scope and affect
other services that also has a similar content type format