.NET Client JSON Serializer exception when deserializing CreateSubscriber response
Hey guys, I'm trying out the .NET sdk (v0.2.2) pointing to api.novu.co (the default) and when creating a Subscriber I get the following exception:
The subscriber does end up getting created though, and when I run the request manually there's really nothing odd about the response (see attached)
![No description](https://cdn.answeroverflow.com/1141975568368279582/CleanShot_2023-08-18_at_08.00.262x.png)
20 Replies
@unicodeveloper @benlin1994 👀
I'll try to repro this in a clean project later
@vinoyl, you just advanced to level 1!
@dr.really please can you help check what's happening here?
Checking
So this happens when doing GetSubscriber, UpdateSubscriber and CreateSubscriber but GetSubscribers does work. Looks to me like the response from those 3 is deserialized directly as a
SubscriberDto
which has the following property:
The Get/Update/Create subscriber methods deserialize the following response into a SubscriberDto
:
So it looks to me that it's attempting to serialize the whole response as a List<AdditionalDataDto>
Doing this gives me direct access to the SubscriberDto
While it should basically be similar to the result of the GetSubscribers
method
@dr.really any updates?
@vinoyl If you are interested there is a pull request pending for the client library.
If you look in the Tests project that are some Integration and Acceptance tests that may help.
see https://github.com/novuhq/novu-dotnet/pull/46
I can make a fix for it, thanks
So basically it's just adding this that's the easiest, similar to
TriggerResponseDto
, so the ISubscriberClient methods return SubscriberResponseDto
instead of directly SubscriberDto
It does break the existing usages though, not sure it really matters since the existing code doesn't work?@vinoyl have you made the fix for it?
@unicodeveloper Well I do have the fix ready, based on the PR branch that @todd7201 mentioned but was waiting to see if it's okay to make a breaking change or if i need to make a workaround like a custom json converter so it doesnt break any usages?
And if I can add it to the existing PR or if I need to make a PR from my own fork?
In the meantime I've just been continuing the integration with the pr branch + my change, let me know how you'd like me to proceed 🙂
@vinoyl, you just advanced to level 2!
@dr.really will really be the best to advise how to proceed here. He's the still taking a look at @todd7201's large PR
I have added a comment https://github.com/novuhq/novu-dotnet/pull/46#discussion_r1300529902 that I can't reproduce the error against 0.17.1 which is the latest deployment docker script.
@vinoyl the problem arose with 0.18.0 release and is now fixed in the pull request.
That's great! Sorry I wasn't very involved any more, been a busy few days