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.
@paulcbetts This is just a first-pass at it so we can talk about the approach.
I've added
BodySerializationMethod.Custom
, because it saved having to change the signature ofRestMethodInfo.BodyParameterInfo
(and it makes a few things easier later), but it's not required --RestMethodInfo.findBodyParameter()
treats any parameter with a type inRefitSettings.CustomSerializers
as a body parameter.Keen to see if this is like what you'd imagined us doing?
One thing I've done a bit differently to what you suggested was that I've made
ITypeSerializer.SerializeAsHttpContent()
synchronous. Making it async pushes a massive amount of changes through the codebase (mostly in tests, to be fair), but do we actually need to do it for serializing the request body?At least the following are still to do:
ITypeSerializer.SerializeAsHttpContent()
async (maybe?)RefitSettings
toRestMethodInfo
and deal with the conflicts later.This will resolve #75.