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

LinkedHashMap keys are not denormalized #456

Open
mdii opened this issue Oct 28, 2024 · 0 comments · May be fixed by #466
Open

LinkedHashMap keys are not denormalized #456

mdii opened this issue Oct 28, 2024 · 0 comments · May be fixed by #466

Comments

@mdii
Copy link

mdii commented Oct 28, 2024

Since 2.8.x LinkedHashMap keys are not denormalized, so all the keys are converted to lowercase. This breaks our application. If we use Map instead of LinkedHashMap the keys are denormalized correctly. We are using two yaml file sources.

This test fails:

class DenormalizedLinkedHashMapKeysTest : FunSpec({
  data class Foo(
    val xVal: String = "x"
  )

  data class LinkedHashMapContainer(
    val m: LinkedHashMap<String, Foo> = linkedMapOf()
  )

  test("should set denormalized map keys and decode a data class inside a linked hash map") {
    val config = ConfigLoaderBuilder.default()
      .addResourceOrFileSource("/test_data_class_in_map.yaml")
      .build()
      .loadConfigOrThrow<LinkedHashMapContainer>()

    config shouldBe LinkedHashMapContainer(
      m = linkedMapOf(
        "DC1" to Foo("10"),
        "DC2" to Foo("20"),
      )
    )
  }
})
mdii added a commit to mdii/hoplite that referenced this issue Dec 30, 2024
mdii added a commit to mdii/hoplite that referenced this issue Dec 30, 2024
@mdii mdii linked a pull request Dec 30, 2024 that will close this issue
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 a pull request may close this issue.

1 participant