This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 540d368fe8d47cd349fc73e476e03e277feced77 Author: Kevin Morin <morin@codelutin.com> Date: Thu Oct 5 14:32:23 2017 +0200 Erreur de sérialisation de la config vide --- .../EmptyVoteCountingConfigSerializer.java | 45 ++++++++++++++++++++++ .../pollen/rest/api/converter/JacksonConfig.java | 2 + 2 files changed, 47 insertions(+) diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/EmptyVoteCountingConfigSerializer.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/EmptyVoteCountingConfigSerializer.java new file mode 100644 index 00000000..0afa64d9 --- /dev/null +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/EmptyVoteCountingConfigSerializer.java @@ -0,0 +1,45 @@ +package org.chorem.pollen.rest.api.converter; + +/*- + * #%L + * Pollen :: Rest Api + * %% + * Copyright (C) 2009 - 2017 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.chorem.pollen.votecounting.model.EmptyVoteCountingConfig; + +import java.io.IOException; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class EmptyVoteCountingConfigSerializer extends JsonSerializer<EmptyVoteCountingConfig> { + + @Override + public void serialize(EmptyVoteCountingConfig voteCountingConfig, + JsonGenerator jsonGenerator, + SerializerProvider serializerProvider) throws IOException, JsonProcessingException { + jsonGenerator.writeStartObject(); + jsonGenerator.writeEndObject(); + } + +} diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/JacksonConfig.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/JacksonConfig.java index ba152e8c..2013f330 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/JacksonConfig.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/converter/JacksonConfig.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import org.chorem.pollen.services.bean.PollenEntityId; import org.chorem.pollen.services.bean.PollenEntityRef; +import org.chorem.pollen.votecounting.model.EmptyVoteCountingConfig; import org.chorem.pollen.votecounting.model.VoteCountingConfig; import javax.ws.rs.ext.ContextResolver; @@ -43,6 +44,7 @@ public class JacksonConfig implements ContextResolver<ObjectMapper> { SimpleModule module = new SimpleModule(); module.addSerializer(PollenEntityId.class, new PollenEntityIdSerializer()); module.addSerializer(PollenEntityRef.class, new PollenEntityRefSerializer()); + module.addSerializer(EmptyVoteCountingConfig.class, new EmptyVoteCountingConfigSerializer()); module.addDeserializer(PollenEntityId.class, new PollenEntityIdDeserializer()); module.addDeserializer(PollenEntityRef.class, new PollenEntityRefDeserializer()); module.addDeserializer(VoteCountingConfig.class, new VoteCountingConfigDeserializer()); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.