.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)
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
GitHub
Release v0.3.0 · novuhq/novu-dotnet
Breaking Change
This release implements breaking changes that will require refactoring. Please take a moment and check out the readme for updates. Thanks to @toddb for his massive work on this rele...
Novu 0.3.0
Novu .NET SDK
I would also like to welcome a new co-contributor to the repo, @todd7201
Thanks a lot @dr.really and @todd7201 🤩
Welcome @todd7201 thank you for this release. 🔥 🚀