Ayodele
09/01/2020, 10:27 AMThe 'From' number xxx is not a valid phone number, shortcode, or alphanumeric sender ID.
nathan
09/06/2020, 6:53 PM//Controller
@PatchMapping("/comment/{id}/")
fun PatchCommentById(@PathVariable id: Long, @RequestBody comment: Comment): ResponseEntity<Comment> {
val updatedComment = repo.save(Comment(
id = id,
body = comment.body,
video_link = comment.video_link,
image_link = comment.image_link,
))
return ResponseEntity.ok(updatedComment)
}
how would u partial update this?nathan
09/12/2020, 2:28 AMGreg Steckman
09/12/2020, 3:31 AMid("io.spring.dependency-management") version "1.0.10.RELEASE"
id("org.springframework.boot") version "2.3.3.RELEASE"
Even without any Spring dependencies declared. If I don't include the dependency-management plugin, the errors do not occur. The errors are:
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.10/998caa30623f73223194a8b657abd2baec4880ea/kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.72/3adfc2f4ea4243e01204be8081fe63bde6b12815/kotlin-stdlib-jdk7-1.3.72.jar (version 1.3)
C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.72/8032138f12c0180bc4e51fe139d4c52b46db6109/kotlin-stdlib-1.3.72.jar (version 1.3)
C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.10/6229be3465805c99db1142ad75e6c6ddeac0b04c/kotlin-stdlib-common-1.4.10.jar (version 1.4)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
and:
e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (8,13) in C:/Users/Greg/Documents/git/test/src/jsMain/kotlin/client.kt
at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
Long stack trace omitted, followed by
Caused by: java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.flatMapIterable(kotlin.sequences.Sequence, kotlin.jvm.functions.Function1)'
at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters(ResolutionParts.kt:393)
at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters$default(ResolutionParts.kt:389)
This was with a new Multiplatform Kotlin project created in IntelliJ, but just adding those 2 plugins to the build.gradle.kts. I think this is an issue with the Spring dependency-management plugin. I am not sure if this is the best place to ask for help with this, if it is a bug or something I am doing wrong. If I should file a bug report in another Spring channel, please advise where that should be. Thanks!Wesley Acheson
09/16/2020, 10:29 AMval
as nullable ). This leads to unnecessary null checks later. Or somehow change how Jackosn creates its PropertyMetadata
object.
---
I'm going to cross post to stack overflow.Michael de Kaste
09/16/2020, 11:00 AMalwyn
09/17/2020, 7:20 PMAyodele
09/18/2020, 8:20 AMAlexJuca
09/20/2020, 9:53 PMrequire
for spring boot rest API's. 👌
v1.1.0 now supports custom error responses!
https://github.com/nextbss/requirektAyodele
09/21/2020, 2:47 PMnathan
09/21/2020, 11:53 PMnathan
09/29/2020, 2:12 AMDsittel
09/29/2020, 7:23 AMthanksforallthefish
10/08/2020, 11:20 AMYevgeni Liskovich
10/11/2020, 10:02 AMnathan
10/13/2020, 4:18 AMsdeleuze
10/13/2020, 5:09 PMwakingrufus
10/15/2020, 4:17 PMfun makeFunctional(Class<?> configClass): (GenericApplicationContext) -> Unit
?bjonnh
10/15/2020, 4:37 PMJonas Bark
10/15/2020, 4:46 PMrunBlocking
"workaround" - thanks @sdeleuze !
Less Kotlin, probably more about Spring itself:
We're also using functional routing for a year now and we're very happy with it. The only thing I miss is support for server side events for Spring MVC projects.
The functional routing receives a ServerRequest
and expects a ServerResponse
in return but I don't see a way to incorporate to respond with the SseEmitter object that is used for SSE on Spring MVC.
Am I missing something or should I open a ticket?gbaldeck
10/16/2020, 5:25 PMthanksforallthefish
10/20/2020, 5:58 AMclass MyRestRepresentation(@get:NotBlank val notBlank: String)
and someone makes an http call like
POST { notBlank: null }
kotlin will throw an exception (jackson will actually) before validation happens. this messes up the error response a bit, since with javax validation we get a nice path to the property that fails validation oob, while otherwise we probably need to do it manually, if at all possible. is Spring working on something like doing validation before before or some other approach or is my best option to declare notBlank
as String?
and just read it as notBlank!!
?Daniel Imber
10/21/2020, 8:29 AMwithContext
inside each and every controller function - something like this:
@GetMapping("/foo")
suspend fun getFoo(): Foo {
withContext(SomeCoroutineContextElement()) {
TODO("Do something")
}
}
Is there a better way - i.e. a way to add the context across all controller functions, so I don't need to litter every one of them with withContext
?hooliooo
10/23/2020, 12:56 PMval inputStream: InputStream = URL(attachmentURL).openStream()
val buffer = DataBufferUtils.readInputStream(
{ inputStream },
DefaultDataBufferFactory(),
8192
)
I’ve integrated the following dependency into my project:
implementation(group = "io.projectreactor", name = "reactor-core", version = "3.3.10.RELEASE")
But i’m getting this error:
Cannot access class 'reactor.core.publisher.Flux'. Check your module classpath for missing or conflicting dependencies
highlighted on readInputStream
Am I missing something?sdeleuze
10/28/2020, 7:41 AMnfrankel
10/29/2020, 7:11 PMrouter
to a corrouter
but the latter expects a ServerResponse
, not a Mono<ServerResponse>
every example i see
the function that generates/read the data is suspend
and returns T
so shall i understand in that case, corrouter
is not a good fit?
or did i miss something?ReddyTintaya
11/03/2020, 2:48 PMconst val reason = "store not found"
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = reason)
class StoreNotFoundException : RuntimeException()
but i want to log the error whenever its been throw
const val reason = "store not found"
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = reason)
class StoreNotFoundException : RuntimeException(){
init {
warningLog(reason)
}
companion object {
private val logger = LoggerFactory.getLogger(CustomException::class.java)
fun warningLog(message: String) {
logger.warn(message)
}
}
}
i've implemented like this
Since i have a lot of exceptions defined like this and i want to have the log whenever one is threw, how can i generalize this behavior?
how can i write a CustomException?Timur Atakishiev
11/09/2020, 4:17 AMspeed_star
11/10/2020, 1:33 PM@EnableWebMvc
exist for? 🤔 I used this annotation. However, when I added @EnableWebMvc
to some Configuration
, the other Configuration
seemed to be disabled...speed_star
11/10/2020, 11:11 PM@RestController
. And I called GET API via curl command with multibyte character query param. But I received 400 error (The valid characters are defined in RFC 7230 and RFC 3986).
Do I need to set some Spring Boot config?