Skip to content
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

Support for custom serializers #83

Closed
wants to merge 1 commit into from
Closed

Conversation

bennor
Copy link
Contributor

@bennor bennor commented Dec 6, 2014

@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 of RestMethodInfo.BodyParameterInfo (and it makes a few things easier later), but it's not required -- RestMethodInfo.findBodyParameter() treats any parameter with a type in RefitSettings.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:

  • Make ITypeSerializer.SerializeAsHttpContent() async (maybe?)
  • Merge in Added JsonSerializerSettings to refitSettings #80 or add RefitSettings to RestMethodInfo and deal with the conflicts later.
  • Add a basic XML serializer as a reference
  • Write tests

This will resolve #75.

@ashutoshraina
Copy link

👍 for this ...I need it right now for dealing with legacy Api's ...when can we see this completed and merged ?

@CSchick
Copy link

CSchick commented Nov 4, 2015

+1 I don't know the code well enough to intelligently make alternate suggestions but the intent and premise of the changes are needed and the approach as explained seems well thought out and professional. :)

@Cheesebaron
Copy link
Contributor

@bennor
Copy link
Contributor Author

bennor commented Nov 4, 2015

This PR is almost a year old. It will probably need a lot of work before we can use it. Might even be worth throwing out and starting again. Unfortunately, I don't have the time for that at the moment.

Would be amazing if one of you wanted to pick it up.

@clairernovotny
Copy link
Member

closing this due to age

@clairernovotny clairernovotny deleted the custom-serializers branch January 29, 2018 03:02
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BodySerializationType.Xml
5 participants