arrow-kt / arrow-integrations

Λrrow Integrations is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
27 stars 6 forks source link

Setup release and update project build #76

Closed i-walker closed 2 years ago

i-walker commented 2 years ago

resolves #70

myuwono commented 2 years ago

This is awesome! Thanks heaps @i-walker !! 🙌

fredgalvao commented 2 years ago

Before I create a new issue, just to make sure:

Does this PR (the upgrade and small fixes with it) address a test like this?

  @Test
  fun basicOptionParsing() {
    val mapper = ObjectMapper()
      .registerKotlinModule()
      .registerArrowModule()

    val optType = mapper.typeFactory.constructParametricType(
      Option::class.java,
      String::class.java
    )
    val nullToOption = mapper.readValue<Option<String>>("null", optType)
    println(nullToOption)
    Assertions.assertEquals(none<String>(), nullToOption, "null didn't parse to none()")

    val valueToOption = mapper.readValue<Option<String>>("\"value\"", optType)
    println(valueToOption)
    Assertions.assertEquals(Some("value"), valueToOption, "\"value\" didn't parse to some()")
  }

I recently found that the latest versions released of all related projects (see list below) cannot satisfy these expectations, and I'm guessing this PR will fix it. Versions:

If I change jackson to 2.12.6, then it passes. I'm also guessing this has to do with what is mentioned in the changelogs for Jackson 2.13:

Fix for databind#3271 to remove unintended coercion of JSON null into Java String "null" (in context of reading Type Id) had the downstream effect of breakage for DropWizard (reported as databind#3313). New behavior is considered correct and will remain in 2.13 and later versions.