Serializing query parameters as json #1727
Unanswered
RavenLiquid
asked this question in
Q&A
Replies: 1 comment
-
Thank you for your feedback, its very useful |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What I thought wo be a simple thing turns out to be mostly impossible it seems. I'm moving so projects from RestEase to Refit and RestEase seems to have a default behavior that letst you serialize complext objects in query parameters to JSON. Refit does not support this, but more importantly I cannot seems to replicate this via any of the documented ways.
The way I think this should work is the formatter route, but the UrlParameterFormatter does not exactly work as expected and will flatten complex types regardless and give you the separate properties instead of the object.
While trying some other method and inhereting from the query attribute I noticed today that yesterdays release has now made the query attribute sealed so that is out of the windows as well.
Is the only way to make this work rebuilding the entire query string in a DelegatingHandler and replace the Query attribute with a Parameter attribute (which is now also sealed, so no extending this either)?
It would be nice if I could just drop this behavior, but it is used and we are stuck it with.
Beta Was this translation helpful? Give feedback.
All reactions