VictorPavfurious commented on code in PR #4541: URL: https://github.com/apache/fineract/pull/4541#discussion_r2031979791
########## fineract-core/src/main/java/org/apache/fineract/infrastructure/serialization/LocalDateArraySerializer.java: ########## @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.infrastructure.serialization; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.time.LocalDate; + +/** + * Custom serialization for covert LocalDate in format array numbers [yyyy, m, d] + */ + +public class LocalDateArraySerializer extends JsonSerializer<LocalDate> { Review Comment: @adamsaghy Hmm, sorry, I overlooked it... But, about LocalDateJsonConverter and LocalDateTypeAdapter, it seems like not duplicate, there working with different serializetion libraries. LocalDateJsonConverter - is working with Jackson and convert to json LocalDate to format String yyyy-MM-dd, but that is strange for me, because like i know, jackson in under hood serialize LocalDate like String yyyy-MM-dd, so it's useless class converter... Second class as LocalDateTypeAdapter - is working with GSON serialize and convert to format yyyy-MM-dd. In my case, we should convert LocalDate to array number, but Jackson by default doesn't do it, so I have created this serialization. I think, on this case i should rewrite exists method "convertToJson" in class LocalDateJsonConverter to correct format data as array number and it'll work nice. And of course, i going to remove my custom serialization. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
