https://kotlinlang.org
Join Slack
What is the preferred way of validating query, path and headers? Wrapping everything in try/catches ...
a

Arjan van Wieringen

over 2 years ago
What is the preferred way of validating query, path and headers? Wrapping everything in try/catches is not really DRY in my opinion. For instance, I'd have a UUID as a path parameter. I use UUID.fromString which might fail. I can wrap that with a try/catch and send a response. What is the idiomatic thing of repeatedly handling validation of these parameters?
a
b
+3
  • 5
  • 6
  • 730
TLDR: our previews always have a white background, even when `uiMode` is set to `UI_NIGHT_MODE_YES` ...
k

Kevin Worth

over 2 years ago
TLDR: our previews always have a white background, even when
uiMode
is set to
UI_NIGHT_MODE_YES
unless we start the preview with
Scaffold
or
Surface
. There must be a better way. Regarding
CompositionLocalProvider
, does anyone have any insight into this SO comment I just made? Basically, it's cool that we can customize/override
LocalContentColor
, but the next thing we reached for (to try to get our previews to look right) was something like
LocalBackgroundColor
or
LocalContainerColor
, etc.
k
e
+5
  • 7
  • 47
  • 730
Hi team. I'm adding logging to my compose-desktop app and it runs well in IDEA but fails to launch J...
g

gyakkun

almost 3 years ago
Hi team. I'm adding logging to my compose-desktop app and it runs well in IDEA but fails to launch JVM when "runDistributable". The error message refers to a JLink(?) issue that the logback package I use hasn't handle well for Java module. May I know if there's any sophisticated solution to export logging to a file in compose-desktop world? Thank you very much. Ref: https://jira.qos.ch/browse/LOGBACK-1515
g
n
  • 2
  • 2
  • 730
How do I send json in form data from the ktor client and receive it on a ktor server? I need multipl...
d

dave08

almost 3 years ago
How do I send json in form data from the ktor client and receive it on a ktor server? I need multiple keys (json and json2) with json data in them in the same request.
d
b
a
  • 3
  • 11
  • 730
Anyone aware of way to create custom deserialization of some "map type" json in to a list (more in t...
j

John O'Reilly

almost 4 years ago
Anyone aware of way to create custom deserialization of some "map type" json in to a list (more in thread)....
j
d
+2
  • 4
  • 33
  • 730
Why are `@Compose` methods starting with uppercase, when Kotlin has lower-case rules for functions? ...
m

Michal Bacik

about 6 years ago
Why are
@Compose
methods starting with uppercase, when Kotlin has lower-case rules for functions? Kotlin lists exception for factory function creating class of same name, but this is not case of Compose. And Compose uses upper-case for its functions, and it's even not tagget in IDE with warning, while ordinary functions show correct warning. https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules
m
f
+13
  • 15
  • 37
  • 730
hello :wave: has anyone tried `value class` with jackson? ```fun main() { val string = ObjectMap...
t

thanksforallthefish

almost 4 years ago
hello šŸ‘‹ has anyone tried
value class
with jackson?
fun main() {
  val string = ObjectMapper().findAndRegisterModules()
    .convertValue<Map<String, String>>(Value("any"))

  println(string)
}

@JvmInline
value class Value(val value: String)
prints
{value=any}
with jackson 2.12.5, but fails with jackson 2.13.0. error is
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('any')
 at [Source: UNKNOWN; byte offset: #UNKNOWN]
though https://github.com/FasterXML/jackson-module-kotlin/issues/464 makes me wonder if my expectation is wrong. my use case is the one marked as ā€œbrokenā€:
"broken": [ {"value":0}, {"value":0} ]
, though this is exactly what I want
t
w
  • 2
  • 1
  • 729
hello guys i am registering a broadcastreceiver dynamically as described in <https://developer.andro...
b

brabo-hi

over 2 years ago
hello guys i am registering a broadcastreceiver dynamically as described in https://developer.android.com/jetpack/compose/migrate/interoperability-apis/views-in-compose#case-study-broadcastreceivers, however i am getting the following error on api 34
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
not kotlin but kotlin colored 0
b
p
  • 2
  • 4
  • 728
Hey all, so I've had this issue happen on both a personal project now and our work project where we ...
j

Josh Eldridge

almost 3 years ago
Hey all, so I've had this issue happen on both a personal project now and our work project where we just brought kotlin multiplatform in, but local builds will build fine but it specifically fails on CI, I've seen this same error happen in a github action and gitlab CI environment when trying to go from kotlin
1.7.10
to
1.7.20
but the stack trace hasn't been super helpful into hunting down exactly why the CI can't find
1.7.20
attaching stack trace in thread:
j
t
  • 2
  • 10
  • 728
How can I dismiss a `DropdownMenu` when it is clicked? Is the only way through `DropdownMenuItem` vi...
c

Chris Fillmore

about 3 years ago
How can I dismiss a
DropdownMenu
when it is clicked? Is the only way through
DropdownMenuItem
via its
onClick
? I’ve tried passing
DropdownMenu(modifier = Modifier.clickable …)
but this doesn’t have any effect that I can see.
c
a
  • 2
  • 8
  • 728
Previous777879Next

kotlinlang

A modern programming language that makes developers happier.

Powered by