
com.zandero.rest.reader.JsonValueReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest.vertx Show documentation
Show all versions of rest.vertx Show documentation
JAX-RS REST annotation processor for vert.x verticals
The newest version!
package com.zandero.rest.reader;
import com.zandero.utils.StringUtils;
import com.zandero.utils.extra.JsonUtils;
import io.vertx.core.json.jackson.DatabindCodec;
import javax.ws.rs.Consumes;
/**
* Converts request body to JSON
*/
@Consumes("application/json")
public class JsonValueReader implements ValueReader {
@Override
public T read(String value, Class type) {
if (StringUtils.isNullOrEmptyTrimmed(value)) {
return null;
}
return JsonUtils.fromJson(value, type, DatabindCodec.mapper());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy