You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support multi-line strings in Database rules JSON #308
I was under the impression multi-line strings were OK, as they publish fine in the rules editor on the console. If this is intended, what's the work-around to get this to deploy whilst preserving the newlines so they stay readable in the console?
Multi-line strings are not currently supported by the CLI when deploying rules. I'll change the title of this to reflect that as a bug/feature request.
To add to this, I think the fact that it mentions firebase.json instead of the actual file that it doesn't like is misleading.
Naturally, people will look at the mentioned file, yet, the problem isn't really there. It is actually in the database.rules.json. While firebase.json read the file in the {"database": {"rules": "..."}, it should mention that the problem lyes in the referenced file.
This could be one of these cases where the tool confuses the developer instead of helping.
So it is now possible to use multiline strings on the database.rules.json? Any recommendation to make it work on VSCode? It is not valid JSON so we can not use JSON as file type
Thanks for the tip @samtstern but how that helps? Broken strings are also a syntax error on JS unless you use inverted ticks ``
And if that is supported inside a JSON file, at that point the file may be better defined as a JS file insted
Activity
mbleigh commentedon Apr 11, 2017
Multi-line strings are not currently supported by the CLI when deploying rules. I'll change the title of this to reflect that as a bug/feature request.
[-]firebase deploy --only database issue ?[/-][+]Support multi-line strings in Database rules JSON[/+]wincentj commentedon Apr 11, 2017
Got it. Thanks!
eliezedeck commentedon Jun 2, 2017
To add to this, I think the fact that it mentions
firebase.jsoninstead of the actual file that it doesn't like is misleading.Naturally, people will look at the mentioned file, yet, the problem isn't really there. It is actually in the
database.rules.json. Whilefirebase.jsonread the file in the{"database": {"rules": "..."}, it should mention that the problem lyes in the referenced file.This could be one of these cases where the tool confuses the developer instead of helping.
db multilines rules not supported firebase/firebase-tools#308
nathanvogel commentedon Jul 25, 2017
This would also make my life easier 👍
Merge pull request #308 from FirebasePrivate/tm/non-interactive-downl…
danielo515 commentedon Apr 4, 2021
So it is now possible to use multiline strings on the database.rules.json? Any recommendation to make it work on VSCode? It is not valid JSON so we can not use JSON as file type
samtstern commentedon Apr 6, 2021
@danielo515 a good trick is to set your syntax highlighter in VSCode (or any IDE) to treat the rules JSON file as a JavaScript file.
danielo515 commentedon Apr 8, 2021
Thanks for the tip @samtstern but how that helps? Broken strings are also a syntax error on JS unless you use inverted ticks
``And if that is supported inside a JSON file, at that point the file may be better defined as a JS file insted
Merge pull request #308 from firebase/clarify-fcm-functions