The Kotlin Moshi adapter returns null when the library throws a JsonDataException because Moshi's default behavior when it encounters invalid JSON is to return null. This behavior can be customized by providing a custom JSON adapter or by using Moshi's lenient mode. In lenient mode, Moshi will attempt to parse the JSON even if it contains errors, but it may produce unexpected results. Generally, it's better to fix the underlying JSON data to avoid JsonDataException errors rather than relying on lenient mode or custom adapters to handle them.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-07-15 11:00:00 +0000
Seen: 11 times
Last updated: Sep 17 '21
How can I implement an OnClickListener for RecyclerView in Kotlin programming language?
How can Django Admin accommodate a variety of formats and locales for its input fields?
How can an array be passed using typo3 flexform xml and itemsProcConfig?
Is it possible to invoke an asynchronous function without using the await keyword?
How can metadata be linked to a series in Polars?
What is the process of utilizing the map function to map a pandas column using a dictionary?