-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Config: Add comments to json config #3086
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration file doesn't need comments, it must be documented in somewhere else, in any case, we could accept both types
What make you think configuration does not need comments...... All the config file that i see in linux system and other systems contain comments. Configuration files are exactly the place that needs comments. |
XML is great. Except when it's used for human-editable configuration. I'd suggest YAML (see https://github.com/nspcc-dev/neofs-node/blob/master/config/example/node.yaml for inspiration), but you can't just throw away old configs, people won't be happy. Keep JSON, add something else. |
You can add comments in json, What you talking about? Checkout https://github.com/cschuchardt88/neo-modules/blob/RestServer/src/RestServer/config.json @superboyiii @vncoelho can verify this. |
@shargon Now revert everything back to json. Only keep the necessary comments that i want. |
I tried to switch to yml, but i think C# does not support yml very well. So just switch back to json. |
I think that comments in json are not in the standard, I need to check, it works with our reader at least |
There is nothing in the standard that says you can't have them. You can choose to support or not as in |
With who? reader? Do we still have any reader left? |
There's a standard to JSON with comments, typically with extension .jsonc ... some IDEs recognize .json as .jsonc, but strictly speaking, it's better to support JSON with Comments (official implementation from Microsoft: https://github.com/Microsoft/node-jsonc-parser) |
Another modern and excelent option for configuration is TOML: https://toml.io/en/ |
We dont need to worry about it, it works already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After command line PR we can create a simplified config with an example of command to call it
Description
This pr uses XML to replace the Json format to config neo node. The reason for this is Json format lacks the ability to add comments, as a result our json config can not tell users what a field is used for and what possible values can be used to set the node.
Fixes # (issue)
Type of change
How Has This Been Tested?
Directly run the node would work.
Test Configuration:
Checklist: