# server

Fred Bowker

03/06/2024, 1:39 PM
Hi everyone, I got a surprise that Kotlin serialization doesn’t serialize, defaults values, by default I think it should serialize these values, as it’s kind of unexpected behaviour. Anyone know how I would change
Copy code
class PostServiceWeb
    properties: AppProperties,
    networkJson: Json,
) : ServiceWeb(
to use a Json that has
Copy code
Json { encodeDefaults = true }
Basically I want to create a default JSON that has this set then it would be injected across the application, or do people change this at the retrofit level, any help would be appreciated
not kotlin but kotlin colored 1


03/06/2024, 1:51 PM
Please don't cross-post to multiple channels, that wastes the time of anyone reading the message multiple times and splits discussions. Pick one appropriate channel according to name and subject and at most post a link in other channels if you really feel you need more attention. @spand how is a question about Kotlin serialization not-kotlin? Besides that this is not the right channel.


03/06/2024, 1:52 PM
He is asking how to perform dependency injection no ?
🤷‍♂️ 1

Fred Bowker

03/06/2024, 1:53 PM
thanks for your reply, I hadn’t realized there was a serialization channel initially, will ensure to not cross-post in the future, cheers
👌 2