novuhq / novu-java

Java SDK for Novu - The open-source notification infrastructure for engineers. 🚀
MIT License
26 stars 22 forks source link

Some subscribers API responses do not match what Java SDK expects #101

Closed m-a-r-1912 closed 6 months ago

m-a-r-1912 commented 9 months ago

It doesn't seem like the CreateBulkSubscriberResponse and UnseenNotificationsCountResponse are "deserializing" the Novu API response correctly.

The CreateBulkSubscriberResponse object doesn’t error out, but the fields aren’t populated and only contain nulls despite the API response having values.

The UnseenNotificationsCountResponse object does cause an error.

Cannot deserialize value of type `Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Long` from Object value (token `JsonToken.START_OBJECT`)
 at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 9] (through reference chain: co.novu.api.subscribers.responses.UnseenNotificationsCountResponse["data"])

Also, markAllSubscriberMessagesFeedAs method errors out due to the SDK expecting Long but instead is receiving a JSON object.

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Long` from Object value (token `JsonToken.START_OBJECT`)
 at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1]
jainpawan21 commented 9 months ago

Hi @m-a-r-1912

Thanks for reporting the issue.

Maintainer will take a look at this