This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git


The following commit(s) were added to refs/heads/master by this push:
     new fd02def  SLING-10933: use QUOTE_TICK for parsing json. (#123)
fd02def is described below

commit fd02def7fc383e9b33043cf8f823794ccaa1978b
Author: Karl Pauls <[email protected]>
AuthorDate: Sun Nov 21 23:59:21 2021 +0100

    SLING-10933: use QUOTE_TICK for parsing json. (#123)
---
 .../apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
 
b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
index 5902d1e..248b97e 100644
--- 
a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
+++ 
b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
@@ -34,6 +34,7 @@ import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.EnumMap;
+import java.util.EnumSet;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Map;
@@ -69,6 +70,7 @@ import org.apache.jackrabbit.vault.util.PlatformNameFormat;
 import org.apache.sling.commons.osgi.ManifestHeader;
 import org.apache.sling.contentparser.api.ContentParser;
 import org.apache.sling.contentparser.api.ParserOptions;
+import org.apache.sling.contentparser.json.JSONParserFeature;
 import org.apache.sling.contentparser.json.JSONParserOptions;
 import org.apache.sling.contentparser.json.internal.JSONContentParser;
 import org.apache.sling.feature.ArtifactId;
@@ -428,7 +430,7 @@ public class BundleEntryHandler extends 
AbstractRegexEntryHandler {
 
     Map.Entry<ContentParser, ParserOptions> getContentParserForEntry(JarEntry 
entry, PathEntry pathEntry) {
         if (entry.getName().endsWith(".json") && 
!pathEntry.isIgnoredImportProvider("json")) {
-            return new AbstractMap.SimpleEntry<>(new JSONContentParser(), new 
JSONParserOptions().withFeatures(JSONParserOptions.DEFAULT_JSON_PARSER_FEATURES));
+            return new AbstractMap.SimpleEntry<>(new JSONContentParser(), new 
JSONParserOptions().withFeatures(EnumSet.of(JSONParserFeature.COMMENTS, 
JSONParserFeature.QUOTE_TICK)));
         } else {
             return null;
         }

Reply via email to