You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/09/20 16:01:05 UTC

[sling-org-apache-sling-feature-io] branch master updated: The runmodes bundle attribute needs to be written out as 'run-modes'

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8f9f599  The runmodes bundle attribute needs to be written out as 'run-modes'
8f9f599 is described below

commit 8f9f599a2dd6e95f29b6491d114827ee7f7a1ae8
Author: David Bosschaert <bo...@adobe.com>
AuthorDate: Thu Sep 20 17:59:59 2018 +0200

    The runmodes bundle attribute needs to be written out as 'run-modes'
    
    Tests for this are present in the modelconverter project.
---
 src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
index 9c77301..10c5e3d 100644
--- a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
+++ b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
@@ -63,6 +63,12 @@ abstract class JSONWriterBase {
                     JsonObjectBuilder bundleObj = Json.createObjectBuilder();
                     bundleObj.add(JSONConstants.ARTIFACT_ID, artifact.getId().toMvnId());
 
+
+                    Object runmodes = md.remove("runmodes");
+                    if (runmodes instanceof String) {
+                        md.put("run-modes", (String) runmodes);
+                    }
+
                     for(final Map.Entry<String, String> me : md) {
                         bundleObj.add(me.getKey(), me.getValue());
                     }