lavalink-devs / Lavalink

Standalone audio sending node based on Lavaplayer.
https://lavalink.dev/
MIT License
1.6k stars 672 forks source link

Add java json API #990

Closed DRSchlaubi closed 12 months ago

duncte123 commented 12 months ago

It would be a good idea to add serialisation/deserialisation helpers as well

DRSchlaubi commented 12 months ago

It would be a good idea to add serialisation/deserialisation helpers as well

https://github.com/lavalink-devs/Lavalink/blob/67ff059c92464716b24bd2ff6993a054ca519e85/protocol/src/commonMain/kotlin/dev/arbjerg/lavalink/protocol/v4/utils/serialization.kt

DRSchlaubi commented 12 months ago

It allows for serialization of JsonPrimitive, JsonArray and JsonObject

duncte123 commented 12 months ago

It allows for serialization of JsonPrimitive, JsonArray and JsonObject

But what about

public record MyTrackUserData(long userId, String anotherArg) {}

Currently it cannot handle this for java users

DRSchlaubi commented 12 months ago

It allows for serialization of JsonPrimitive, JsonArray and JsonObject

But what about

public record MyTrackUserData(long userId, String anotherArg) {}

Currently it cannot handle this for java users

Well yeah, but kotlinx.serialization has a compiler plugin, which generates the serializer (this is what @Serializable does), you cannot do that for a java record, so I can't handle that

topi314 commented 12 months ago

replaced by https://github.com/lavalink-devs/lavalink-client/pull/12