-
Notifications
You must be signed in to change notification settings - Fork 494
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
Error with ToStream using a custom CosmosSerializer #575
Comments
The easiest fix is for it to use the default serializer for the query text generation. Is there any scenario where a user would need to do custom serialization of the query text? |
How do I choose when the client uses the default versus a custom serializer? |
There isn't a way exposed to users. It's set in the CosmosQueryClientCore in the SDK internally. I'm working on a PR now to change it. |
We are planning on doing a release early next week as long as we don't hit any major issues. Also we didn't hit this issue with our test because our test have access to internal types so we can unit test different scenarios. |
Microsoft.Azure.Cosmos 3.5.1 appears to have a similar issue: The following is encountered when performing a query with parameters: Sample serializer using newtonsoft
Query with the template string returns properly. Query with Parameters fails with the above exception |
Describe the bug
When using a custom serializer, calling a query method results in an error in the ToStream override, I think because Microsoft.Azure.Cosmos.SqlQuerySpec is internal and not accessible.
To Reproduce
Code is available here:
https://stackoverflow.com/questions/57100837/error-with-getitemqueryiterator-when-using-a-custom-cosmosserializer
Expected behavior
I would think that either the SqlQuerySpec should be available for serialization in this matter, or the call should be routed differently so as to not go through custom serialization.
Environment summary
SDK Version: 3.0
OS Version (e.g. Windows, Linux, MacOSX) Windows
Additional context
Add any other context about the problem here (for example, complete stack traces or logs).
Error message:
System.NotSupportedException: 'The collection type 'Microsoft.Azure.Documents.SqlParameterCollection' on 'Microsoft.Azure.Documents.SqlQuerySpec.Parameters' is not supported.'
The text was updated successfully, but these errors were encountered: