prevent response serialization from assuming objects are relations #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change in #27 fixed serializing query responses with object values, but serializing foreach responses stopped working. This PR switches back to roughly the logic in which foreach responses were working, and fixes the issue with object values in a different way.
This is a quick patch - we still need to rework response serialization to use
bson_to_json
translation. That will require using the query request to direct response serialization which should make everything more robust.I removed the use of
JsonResponse
in this PR because it serves no purpose for this connector.JsonResponse
is useful for connectors that get a JSON response from the database, which the connector can pass through without processing. But as far as we can determine MongoDB always sends BSON so to get JSON output we're stuck doing response processing in the connector.Fixes https://hasurahq.atlassian.net/browse/MDB-19