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

Unexpected character exception deserializing response from ContactsClient.List() #160

Open
iPlexor opened this issue May 15, 2020 · 0 comments

Comments

@iPlexor
Copy link

iPlexor commented May 15, 2020

Using the nuget release 2.1.1 and the current master branch, calling List() on ContactsClient results in a sucessful request and response but throws an exception when deserializing the response json into the Contacts class.

Inner Exception Message:

Unexpected character encountered while parsing value: {. Path 'pages.next', line 1, position 18348.

This appears to be due to the v2.0 API returning a 'next' pagination object, rather than a string as expected in the current class data structure.

This can be fixed by providing a Next class as follows:

namespace Intercom.Data
{
	public class Next
	{
		public int page { get; set; }
		public string starting_after { get; set; }
	}
}

and switching next in Page.cs from a string to this the new object like so:

namespace Intercom.Data
{
	public class Pages : Model
	{
		public Next next { get; set; }
		public int page { get; set; }
		public int per_page { get; set; }
		public int total_pages { get; set; }
	}
}

I will prepare a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant