https://kotlinlang.org logo
#http4k
Title
# http4k
r

Razvan

10/16/2020, 2:47 PM
Hi, again. when writing the meta of OpenApi json generation, Is there a way to add description and/or example for the
headers
or
queries
? Your examples only cover body and Path but couldn't from that figure it out for queries.
d

dave

10/16/2020, 2:49 PM
Copy code
headers += Header.required("name", "description")
r

Razvan

10/16/2020, 2:52 PM
Thanks missed that description parameter in the lens
d

dave

10/16/2020, 2:54 PM
if you think that something should be there, it probably is so it's always worth clicking through and checking the source 🙂
r

Razvan

10/16/2020, 4:06 PM
Sometime IntelliJ doesn't want me to go there. Ex. Query.optional() can't click on optional, and I already seen that some other places.
d

dave

10/16/2020, 4:25 PM
hmm - make sure you're downloading sources and that your idea and kotlin plugin are up to date
r

Razvan

10/16/2020, 8:55 PM
All is up to date, gradle is set to
all
I can go to other sources. i think there are some extensions that are difficult to find. happens to Querry.`optional`() (Querry works), also on
bindContract
or
defaulted
in (
<http://EnvironmentKey.int|EnvironmentKey.int>().defaulted()
) clicking on it, I get a short message "Cannot find declaration to go to".
d

dave

10/16/2020, 11:28 PM
If you invalidate caches and restart? Or try another new project ? Or wipe out the grtafle cache? I did have a problem with one project after I upgraded http4k with having multiple versions of the jar in the external.libs. If nothing else then maybe idea bug?
r

Razvan

10/18/2020, 9:35 AM
Just to let you know, neither help invalidating cache, new helloworld project still have the problem with these specific functions. It happens both on Linux and macOS, and both IntelliJ Ultimate or Community. Looks like a bug because if I look intro the Query.optional(), optional is just a function of BiDiLensSpec of which Query inherits. So it shouldn't be that difficult to figure out... 🤔 No big deal, I can navigate to source code even if it's indirectly so no excuse 😁
d

dave

10/18/2020, 9:59 AM
Yep - I can recreate it here as well. But it doesn't happen with similar object relationships so am not sure what's going on in Idea.
3 Views