Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Comments in JSON File Cause Exception #299

Closed
DaleyKD opened this issue Feb 14, 2023 · 4 comments
Closed

Comments in JSON File Cause Exception #299

DaleyKD opened this issue Feb 14, 2023 · 4 comments

Comments

@DaleyKD
Copy link

DaleyKD commented Feb 14, 2023

I realize that official JSON files don't support comments. However, .jsonc files aren't as fussy. 😄

I'm trying to use a .jsonc file (because I want to help our developers know what each token replace means/does). In PowerShell, ConvertFrom-Json does not seem to get upset if there are comments.

Is it possible for this task to allow comments? I know I COULD use YAML, but that causes another issue further down the path.

Thank you for your consideration.

@qetza
Copy link
Owner

qetza commented Feb 14, 2023

Hi @DaleyKD,
I'll try to find a library which can read JSON with comments or strip comments before parsing the files and use it instead of the standard library.

@DaleyKD
Copy link
Author

DaleyKD commented Feb 14, 2023

@qetza : That would be glorious. Thank you!

@DaleyKD
Copy link
Author

DaleyKD commented Feb 14, 2023

I have no idea, but I stumbled across JSON5.org today.

@qetza
Copy link
Owner

qetza commented Aug 8, 2023

Hi @DaleyKD,
A new version of the task is released and contains support for comments in JSON variable files.

@qetza qetza closed this as completed Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants