Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLING-8419 write back configuration in OSGi JSON format #2

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

kwin
Copy link
Member

@kwin kwin commented Jan 4, 2020

No description provided.

@kwin kwin requested a review from cziegeler January 4, 2020 17:53
@kwin kwin force-pushed the feature/json-config-writeback branch from 13588e8 to 299a71e Compare January 4, 2020 17:54
@kwin kwin merged commit 1bd4235 into master Jan 6, 2020
@kwin kwin deleted the feature/json-config-writeback branch January 6, 2020 16:51
}

try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(file))) {
fos.write("# Configuration created by Apache Sling File Installer\n".getBytes(StandardCharsets.UTF_8));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure the # character introduces a valid comment in JSON…
Then again https://sling.apache.org/documentation/bundles/configuration-installer-factory.html mentions being allowed to use // comments, which also would not be valid JSON…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first issue was reported and solved in the context of https://issues.apache.org/jira/browse/SLING-9218.

Comments are allowed though, as specified in https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e131566:

Comments in the form of [2] JSMin (The JavaScript Minifier) comments are supported, that is, any text on the same line after // is ignored and any text between /* */ is ignored.

In any case this PR has already been merged. If you find any issue feel free to report it via https://issues.apache.org/jira/browse/SLING!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants