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

Representation Hints #149

Closed
zml2008 opened this issue Apr 21, 2020 · 0 comments
Closed

Representation Hints #149

zml2008 opened this issue Apr 21, 2020 · 0 comments
Milestone

Comments

@zml2008
Copy link
Member

zml2008 commented Apr 21, 2020

On the quest for perfect round-tripping of configurations, it turns out many configuration formats have multiple ways to represent a single value type. Right now we don't keep track of how the loaded file represented its information, and when writing rely on the underlying libraries to choose how to represent the data. Often the libraries don't make choices that users like.

To resolve this, each configuration node will have to have metadata describing how it should be represented. While some keys may be provided in a common form, the loaders will decide which ones they work with. Unsupported keys must be accepted and ignored -- this provides a place to include node metadata that will not be directly serialized.

Some examples of representation hints are:

  • YAML flow style -- block|flow|auto
  • JSON: pretty printed or not
  • HOCON and YAML strings: One line with escaped newlines, or a block of text?
  • TOML: Inline or block syntax
  • any format: line spacing between entries? maybe?

Some example of things that may be representation hints:

  • a header, because it's not directly part of the node, but maybe not because it is content that is written to the file

Some things that are not representation hints are:

  • Comments -> these are part of the node's data

Implementing representation hints provides a path to resolving issues like #96 and #145

Further question: how much would representation hints take away from information that is currently in ConfigurationOptions? While ConfigurationOptions has more global information, some of it could be applicable.

@zml2008 zml2008 added this to the 4.0 milestone Apr 21, 2020
zml2008 added a commit that referenced this issue May 30, 2020
@zml2008 zml2008 closed this as completed in effc391 Oct 4, 2020
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