Closed mizosoft closed 9 months ago
Hi @mizosoft thank you for merging this. Could you tag a new release with this feature?
Hey @MarkusWendorf, I'm still working on proper native image support for the next release. In the meantime, feel free to use the snapshot version. This particular feature seems to be finalized for the next release (unless it has any problems, of course). You can use the snapshot from gradle as follows:
repositories {
mavenCentral()
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencies {
implementation("com.github.mizosoft.methanol:methanol:1.8.0-SNAPSHOT")
implementation("com.github.mizosoft.methanol:methanol-jaxb-jakarta:1.8.0-SNAPSHOT")
implementation("com.sun.xml.bind:jaxb-impl:4.0.3")
}
You can install the adapter more easily than previous versions using the new AdapterCodec
API:
var client = Methanol.newBuilder()
.adapterCodec(AdapterCodec.newBuilder()
.encoder(JaxbAdapterFactory.createEncoder())
.decoder(JaxbAdapterFactory.createDecoder())
.build())
.build();
var response = client.send(MutableRequest.GET("https://example.com/data"), MyXmlType.class);
System.out.println(response.body());
Feel free to provide any feedback.
Closes #65