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

Make sure zio-config doesn't support values as list without proper indexing #1086

Merged
merged 13 commits into from
Feb 26, 2023

Conversation

afsalthaj
Copy link
Collaborator

@afsalthaj afsalthaj commented Feb 25, 2023

The library zio-config didn't mean to support considering any separated by comma as a list, since it already make use of indexed formats. All the configs handled by ZIO Config are indexed, and has a format that support list natively.

However, internally it was making using ConfigProvider.Flat.parsePrimitive which assumes a value that has strings separated by comma is a list

This support now removed (since the library should never make use of this feature), which will hopefully fix issues such as #1085

Example:

  {
     values: [1, 2, 3]
     complex_values : [

       {
          x : 10
          y : 11
       },

      {
         x : 12
         y : 13
      }
    ]
  }

Will be considered as

values[0] -> 1
values[1] -> 2
values[2] -> 3
complex_values[0].x -> 10
complex_values[0].y -> 11
complex_values[1].x -> 12
complex_values[1].y -> 13


Addition cleanups

  • As a minor clean up, we have also moved xml into an experimental package, and updated the documentations
  • Fixed examples
  • Although not perfect yet, try to keep the order of list in the config

@afsalthaj afsalthaj requested a review from a team as a code owner February 25, 2023 18:44
@afsalthaj afsalthaj merged commit 17efd3c into series/4.x Feb 26, 2023
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.

None yet

1 participant