v79
08/20/2021, 10:15 AMRichard Gomez
08/20/2021, 7:01 PMfun apiResponseOf(code: Int, kclass: KClass<*>) = ApiResponse(responseCode = code.toString(), content = arrayOf(Content(schema = Schema(kclass))))
@Operation(summary = "List all Foos")
@ApiResponses(
apiResponseOf(200, FooResponse::class)
)
Instead of:
@Operation(summary = "List all Foos")
@ApiResponses(
ApiResponse(responseCode = "200", content = [Content(schema = Schema(implementation = FooResponse::class))])
)
Siva Nimmala
08/20/2021, 8:58 PMnilTheDev
08/21/2021, 3:48 PMKotlin
. I feel gradle
is indispensable for any kotlin
project. Be it in Android
or some other frameworks. But it is still a magic for me. How does it pull stuff from the repositories, how does it build projects and so on. Any suggestion on where I can learn about it from the bottom-up? Only some basics stuff that we use day-to-day would be fine. It doesn't feel comfortable to use some tool that I don't understand.MisileLab
08/22/2021, 3:08 AMŁukasz Bednarczyk
08/22/2021, 7:05 PMAnil Kumar
08/23/2021, 5:21 PMPablo Schmid
08/23/2021, 11:00 PMJames Whitehead
08/24/2021, 11:36 AMisInterface
? I see we have isAbstract
, isOpen
, etc, but I haven't found anything for interface.
2. Follow up question; is MyClass::class.java.interfaces
the recommended way to get the interfaces implemented by a given class?Alexander Suraphel
08/24/2021, 4:34 PM*val* x: String? = y *as* String?
and
*val* x: String? = y *as*? String
?xii
08/24/2021, 7:32 PMxii
08/24/2021, 7:34 PMalthaf
08/26/2021, 7:34 AMval s: Array<LongArray> = Array(5) { LongArray(10) }
println("size" + s[0].size)
is this the only way to get col size ^^Justin Tullgren
08/26/2021, 1:45 PMfun interface
types when creating them using the lambda syntax? I can't seem to make it work without actually making a concrete class.jean
08/26/2021, 2:11 PM@Serializable
data class ApiResponse<T> (
@Serializable(with = HttpStatusCodeSerializer::class)
val code: HttpStatusCode,
val errors: List<KlubberError> = emptyList(),
val data: T,
)
Does it make sense to use a type ApiResponse<Nothing>
in case of errors? And what should I pass for the data
parameter?
val response = ApiResponse<Nothing> (
code = myCode,
errors = listOf(error1, error2),
data = <what should I use here?>,
)
Using Unit instead of Nothing allows me to write data = Unit
is that a better approach?Alex
08/26/2021, 2:32 PMMisileLab
08/26/2021, 3:55 PMUnresolved reference: implementation
My build.gradle.kts file
https://pastebin.com/EAcCPBffKirill Grouchnikov
08/26/2021, 7:39 PMByteArray
to byte[]
so that I can pass it to a Java method that accepts the "traditional" byte arrays?nkiesel
08/26/2021, 8:35 PM(1..10).sumOf { if (it % 2 == 0) 1 else 0 }
. This looks like a bug to me (I tried both 1.5.21 and 1.5.30). I can avoid that using e.g. (1..10).sumOf { if (it % 2 == 0) 1L else 0L }
or (1..10).sumOf { if (it % 2 == 0) 1.toInt() else 0.toInt() }
, but the first one produces a Long
instead of an Int
and the 2nd one is just ugly.Patrick Ramsey
08/27/2021, 4:41 AMJason5lee
08/27/2021, 6:33 AMa.b.c.d
and in another place I can import a.b.c.d
and reference them as `d.TypeName`/`d.function`. Is there a better way other than defining the inner d
as an object and put everything inside, which I’m not sure whether it is a good practice.jeggy
08/27/2021, 8:57 AM'this@with' is not captured
.
Is there anything I can disable to not optimise the Kotlin Compiler when running in debug mode?mcpiroman
08/27/2021, 1:05 PMMisileLab
08/27/2021, 1:49 PMJonathan Mew
08/27/2021, 2:48 PMvalue class
queries 🧵Chris Fillmore
08/27/2021, 3:44 PMRichard Gomez
08/27/2021, 3:54 PM'name' overrides nothing
.
// OAuth2User.java
public interface OAuth2User {
String getName();
}
Pablo Schmid
08/27/2021, 9:11 PMDmitry
08/28/2021, 4:45 AMelect
08/28/2021, 9:15 AMpublic interface Named {
String getName();
is there a way to overwrite that in an extending class using a plain field (var name: String
) instead of using mandatory a method?elect
08/28/2021, 9:15 AMpublic interface Named {
String getName();
is there a way to overwrite that in an extending class using a plain field (var name: String
) instead of using mandatory a method?ephemient
08/28/2021, 10:13 AMelect
08/28/2021, 4:20 PM