Browse Source

changes in json validation service

master
yoganandhank 1 year ago
parent
commit
29c7048c81
  1. 4
      pom.xml
  2. 1
      src/main/java/com/gcc/crslogs/service/BirthAndDeathDetailsService.java

4
pom.xml

@ -63,11 +63,13 @@
<build> <build>
<plugins> <plugins>
<!-- Spring Boot Plugin -->
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build>
</build>
</project> </project>

1
src/main/java/com/gcc/crslogs/service/BirthAndDeathDetailsService.java

@ -120,6 +120,7 @@ public class BirthAndDeathDetailsService {
// Remove illegal control characters (but keep line breaks if needed) // Remove illegal control characters (but keep line breaks if needed)
return rawJson return rawJson
.replace("\\", "\\\\") // Escape backslashes
.replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", "") // Remove non-printable control characters (except tabs/newlines) .replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", "") // Remove non-printable control characters (except tabs/newlines)
.replaceAll("\t", "") // Remove tab characters explicitly (common cause of error) .replaceAll("\t", "") // Remove tab characters explicitly (common cause of error)
.replaceAll("\\s*:\\s*\n\\s*\"", ":\"") // Fix broken key-value splits .replaceAll("\\s*:\\s*\n\\s*\"", ":\"") // Fix broken key-value splits

Loading…
Cancel
Save