what have you done with the swagger mapping... loo...
# http4k
r
what have you done with the swagger mapping... looks like the keys are mapped to lowecase mapping is kinda failing...
Copy code
data class TestData(
    val s1: Int? = null,
    val sXe: Int? = null,
)
object TestRoute {
    val bodyTest = Body.auto<TestData>().toLens()

    operator fun invoke(): ContractRoute {
        val metaData: RouteMetaDsl.() -> Unit = {
            tags += Tag("aaa")
            returning(
                Status.OK,
                bodyTest to TestData(s1 = 1, sXe = 22)
            )
        }
        return "/test" meta metaData bindContract Method.GET to { _: Request -> Response(Status.OK).with(bodyTest of TestData(s1 = 1, sXe = 12))  }
    }
}
if in the example
sXe
has a value the /api/swagger.json fails to load:
Copy code
Could not find sxe in TestData(s1=1, sXe=22)
if i set it to null in the example it loads but when i run the query I get as response body
Copy code
{
  "s1": 1,
  "sxe": 12
}
Looks like the uppercase
X
is no longer in uppercase... In
4.17.2.0
Strange, I got other endpints for which that works.... why the heck this one does not...
Copy code
"universeCode": "XXX",
    "universeLabel": "yyyy",
    "familyCode": "11",
d
Was there a Jackson upgrade between the versions?
#deflection 😂
r
Using the one you provide with http4k
d
Yep - but what version did you upgrade from?
We did introduce the OpenApiJackson somewhat recently
r
"4.14.1.2"
so i guess it might be that 😉
turns out is because is a single lowercase before the upercase. if I add a lowercase letter like
seX
it works
d
That definitely smells like a Jackson change.
Suggest checking the maven dependency tree for the different versions
(of Http4k-format-jackson)
There are the Jackson annotations that might help if it is that
r
turns out that it's just a new api that's why after migrating to the latest version (it uses jackson 2.13) all was ok... so i just have to rename that key no big deal... I try to avoid annotations when possible.
d
Yep - us too. 🙃
r
looks like nobody have problems with jackson, only two open issues... 😉
lol not the right repository 😉
d
Says 390 open issues on my browser...
r
was just the jackson repo (just the portal) others have plantly
Turns out 2.12 has the problem too, just never used a short enough key https://github.com/FasterXML/jackson-module-kotlin/issues/475 thanks for your time
d
Np 🙃