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

Flatten yaml properties with list and map context. #335

Merged
merged 2 commits into from
Jun 29, 2020

Conversation

radcortez
Copy link
Member

@radcortez radcortez commented Jun 18, 2020

Proposal to flatten the yaml into config properties without losing map / list context for conversion.

The entire yaml is flatten by keeping context of any list index in the property name in the style:
for.[0].bar
for.[1].bar

This allows to read the config directly per index if the consumer knows what he wants. Additional, the key foo.bar will keep a dumped version of the original yaml so it can also be easily converted.

A few additional things can be added:

  • additional flattening when a list contains only one element. either drop the index or use a specific name in the config property name.
  • converters

@radcortez radcortez merged commit 26bdd7f into smallrye:master Jun 29, 2020
@radcortez radcortez added this to the 1.8.2 milestone Jul 9, 2020
@radcortez radcortez deleted the yaml branch July 11, 2020 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant