arrow-endpoint
arrow-endpoint copied to clipboard
Move tests to correct folder
I think we moved this test file into a wrong folder, so it stops running ( that why we thought it passes). But it is actually still failed.
Damn, that's too bad :( Good we have a failing test now, hopefully we can fix it easily.
Relevant:
- https://youtrack.jetbrains.com/issue/KT-50764
- https://github.com/Kotlin/kotlinx.serialization/issues/610
- https://github.com/Kotlin/kotlinx.serialization/issues/1705#issuecomment-1001786343
Moving to Kotlin 1.6.0 fixes the issue for me. I'm also going to attempt to use the workaround, since this is internal anyway.
@lenguyenthanh this is the fix following the tickets on the trackers.
@Serializable(with = ReferencedSerializer::class)
public open class Referenced<out A> internal constructor() {
public data class Ref(public val value: Reference) : Referenced<Nothing>()
public data class Other<A>(val value: A) : Referenced<A>()
public fun <B> map(f: (A) -> B): Referenced<B> =
when (this) {
is Other -> Other(f(value))
is Ref -> this
else -> TODO("Impossible.")
}
}
Test locally, and in downstream project and it fixes the issue for me. I can add/push this fix on your branch later if you like so we can see this test pass.
Great thanks @nomisRev ! I will try it local and push it to this branch.
It worked locally, and open-api
module is also working now for the first time 🎉
According to YouTrack this should be fixed in Kotlin 1.6.20, which is currently in M1.
So perhaps we should wait a bit to merge this PR. Hopefully in the next week we can introduce alpha
releases like in Arrow, and maybe Kotlin 1.6.20 will be released by then.
Off-topic
@lenguyenthanh Are you depending on the SNAPSHOT? I also found they have an incorrect name.
"io.arrow-kt:ktor-server:0.1.2-SNAPSHOT"
"io.arrow-kt:openapi-docs:0.1.2-SNAPSHOT"
instead of
"io.arrow-kt:arrow-endpoint-ktor-server:0.1.2-SNAPSHOT"
"io.arrow-kt:arrow-endpoint-openapi-docs:0.1.2-SNAPSHOT"
Thanks for reporting and helping looking into this @lenguyenthanh ❤️
Yeah, I agree with your approach, no need to rush to merge this PR.
I'm still using my Jitpack version. But I will try to use the snapshot version soon. Thanks for the head up, @nomisRev !