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

[File inclusion] add support for representing a text file as an array of lines #20

Closed
nemesifier opened this issue Oct 21, 2015 · 0 comments
Assignees
Milestone

Comments

@nemesifier
Copy link
Member

The only way to add strings containing new lines in JSON is to use the escaped form \n.

Therefore to add a file with multiple lines in netjsonconfig now one has to do:

{
    "files": [
        {
            "path": "/root/.ssh/authorized_keys",
            "contents": "sshkey1\nsshkey2\nsshkey3"
        }
    ]
}

It would be nice to add support to an array representation, each element of the array representing a line of a file:

{
    "files": [
        {
            "path": "/root/.ssh/authorized_keys",
            "contents": [
                "sshkey1",
                "sshkey2",
                "sshkey3"
            ]
        }
    ]
}

This would also improve readability a great deal.

@nemesifier nemesifier added this to the 0.2 milestone Oct 21, 2015
@nemesifier nemesifier self-assigned this Oct 21, 2015
nemesifier added a commit that referenced this issue Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant