Use Avaje Jsonb for Javalin JSON (#2512)

This commit is contained in:
Alan Everett
2026-06-09 20:20:21 -04:00
committed by GitHub
parent 7b30c9306e
commit c04c8d76ed
3 changed files with 4 additions and 1 deletions

View File

@@ -34,7 +34,7 @@ ext {
wpilibVersion = "2027.0.0-alpha-6"
openCVversion = "2027-4.13.0-3"
ejmlVersion = "0.43.1";
avajeJsonbVersion = "3.14-RC4";
avajeJsonbVersion = "3.14";
msgpackVersion = "0.9.0";
quickbufVersion = "1.3.3";
jacocoVersion = "0.8.14";

View File

@@ -17,6 +17,7 @@
package org.photonvision.server;
import io.avaje.jsonb.javalin.JavalinJsonb;
import io.javalin.Javalin;
import io.javalin.plugin.bundled.CorsPlugin;
import java.net.InetSocketAddress;
@@ -103,6 +104,7 @@ public class Server {
return "Got WebSockets binary message from host: " + host;
}));
});
javalinConfig.jsonMapper(new JavalinJsonb());
});
/* Web Socket Events for Data Exchange */

View File

@@ -37,6 +37,7 @@ dependencies {
implementation group: "io.avaje", name: "avaje-jsonb", version: avajeJsonbVersion
annotationProcessor group: "io.avaje", name: "avaje-jsonb-generator", version: avajeJsonbVersion
implementation group: "io.avaje", name: "avaje-jsonb-jackson", version: avajeJsonbVersion
implementation group: "io.avaje", name: "avaje-jsonb-javalin-mapper", version: avajeJsonbVersion
implementation group: "org.ejml", name: "ejml-simple", version: ejmlVersion
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: quickbufVersion;