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 we are using format 
array numbers [yyyy, m, d], so this class broke logic... LocalDate should 
convert to array format, not for String because our client use it format and 
integration tests too... So, i have few questions: 
   1) Why do we convert LocalDate to String format, when client and tests 
expecting array numbers ?
   2) Should rewrite method convertToJson in class LocalDateJsonConverter to 
format array number?
   
   My suggestion - we must have 100% compatibility with GSON serialization, 
(unfortunately), but we must use format as [yyyy, m, d]. So, need to rewrite 
method convertToJson in class LocalDateJsonConverter to correct format.
   
   Second class as LocalDateTypeAdapter - is working with GSON serialize and 
convert to format yyyy-MM-dd. I think that class will deprcated soon. 



##########
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:
   @vidakovic  could you help with above questions and suggestions ? 



-- 
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]

Reply via email to