@@ -0,0 +1,2256 @@
+/**%0A * Copyright (C) 2015 The Gravitee team (http://gravitee.io)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *         http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage io.gravitee.definition.jackson.datatype.api.deser;%0A%0Aimport com.fasterxml.jackson.core.JsonParser;%0Aimport com.fasterxml.jackson.databind.DeserializationContext;%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;%0Aimport io.gravitee.definition.model.Property;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com)%0A * @author GraviteeSource Team%0A */%0Apublic class PropertiesAsListDeserializer extends StdScalarDeserializer%3CList%3CProperty%3E%3E %7B%0A%0A    public PropertiesAsListDeserializer() %7B%0A        super(List.class);%0A    %7D%0A%0A    @Override%0A    public List%3CProperty%3E deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException %7B%0A        JsonNode node = jp.getCodec().readTree(jp);%0A%0A        List%3CProperty%3E values = new ArrayList%3C%3E();%0A%0A        if (node.isArray()) %7B%0A            node%0A                .elements()%0A                .forEachRemaining(%0A                    jsonNode -%3E %7B%0A                        try %7B%0A                            Property property = jsonNode.traverse(jp.getCodec()).readValueAs(Property.class);%0A                            values.add(property);%0A                        %7D catch (IOException e) %7B%0A                            e.printStackTrace();%0A                        %7D%0A                    %7D%0A                );%0A        %7D else if (node.isObject()) %7B%0A            node.fields().forEachRemaining(jsonNode -%3E values.add(new Property(jsonNode.getKey(), jsonNode.getValue().asText())));%0A        %7D%0A%0A        return values;%0A    %7D%0A%7D%0A

add PropertiesAsListDeserializer