Garzec
Garzec
Explore posts from servers
SSolidJS
Created by Garzec on 4/28/2025 in #support
How do Layouts work with SolidStart?
Ah, thanks for the help πŸ™‚
9 replies
SSolidJS
Created by Garzec on 4/28/2025 in #support
How do Layouts work with SolidStart?
ah, thanks! But it isn't quite clear to me how to do it for root layouts :S A single index page with a base layout should be
/routes/index.tsx // layout
/routes/index/(index).tsx // additional folder + page
/routes/index.tsx // layout
/routes/index/(index).tsx // additional folder + page
?
9 replies
NNuxt
Created by Garzec on 4/25/2025 in #❓・help
Does Nuxt UI ship its own form library?
@kapa.ai yeah so with Nuxt UI we don't need additional libraries like Vee Validate right
9 replies
SSolidJS
Created by Garzec on 4/11/2025 in #support
Is it recommended to use Start even if you don't need it?
@jer3m01 one stupid question... sorry. When having ssr: false, where do I find the build files for deployment? I don't think it's inside the .vinxi dir. So I had a look at .output. Is it in /.output/public ... ? I'm not sure there are a lot of server files and stuff πŸ€”
9 replies
SSolidJS
Created by Garzec on 4/11/2025 in #support
Is it recommended to use Start even if you don't need it?
ah thanks a lot πŸ™‚ Taken from here? https://docs.solidjs.com/solid-start/reference/config/define-config#parameters So when using ssr: false Start turns into a basic Solid app with file based routing?
9 replies
SSolidJS
Created by Garzec on 4/11/2025 in #support
Is it recommended to use Start even if you don't need it?
@jer3m01 thanks! πŸ™‚ Unfortunately I wasn't able to find things in the docs like "How to build for SPA / SSG only" ( like basic Solid apps )
9 replies
SSolidJS
Created by Garzec on 4/10/2025 in #support
Which form validation library are you using?
thanks πŸ™‚ Unfortunately this library only supports Zod and Valibot. Would like to give ArkType a try
6 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes, I think I got this ( as shown in my code above )
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
no, same for INTERNAL_SERVER_ERROR Is there some Spring magic required? Do I have to place this exception handler file into a specific directory with a conventional name or so...
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes, the default Spring behavior for invalid request bodies I guess
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
if /foo is valid, it executes the rest handler, if it's invalid then Spring responds with a 400, so handleValidationException never runs
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
sorry, the function handleValidationException never runs
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes please
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
you only get a 400 with
{
"timestamp": "2025-01-12T18:11:01.102+00:00",
"path": "/foo",
"status": 400,
"error": "Bad Request",
"requestId": "2e927c69-2"
}
{
"timestamp": "2025-01-12T18:11:01.102+00:00",
"path": "/foo",
"status": 400,
"error": "Bad Request",
"requestId": "2e927c69-2"
}
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
nothing, when I set a breakpoint, it won't run the function
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
you mean like so?
import org.springframework.http.HttpStatus
import org.springframework.validation.FieldError
import org.springframework.web.bind.MethodArgumentNotValidException
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestControllerAdvice

@RestControllerAdvice
class ValidationExceptionHandler {
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(MethodArgumentNotValidException::class)
fun handleValidationException(
exception: MethodArgumentNotValidException
): ValidationErrorResponse {
val fieldErrors = exception.bindingResult.allErrors.associate { error ->
val fieldName = (error as FieldError).field
val errorMessage = error.defaultMessage

fieldName to errorMessage
}

return ValidationErrorResponse(fieldErrors)
}
}

data class ValidationErrorResponse(val fieldErrors: Map<String, String?>)
import org.springframework.http.HttpStatus
import org.springframework.validation.FieldError
import org.springframework.web.bind.MethodArgumentNotValidException
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestControllerAdvice

@RestControllerAdvice
class ValidationExceptionHandler {
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(MethodArgumentNotValidException::class)
fun handleValidationException(
exception: MethodArgumentNotValidException
): ValidationErrorResponse {
val fieldErrors = exception.bindingResult.allErrors.associate { error ->
val fieldName = (error as FieldError).field
val errorMessage = error.defaultMessage

fieldName to errorMessage
}

return ValidationErrorResponse(fieldErrors)
}
}

data class ValidationErrorResponse(val fieldErrors: Map<String, String?>)
That still doesn't work 😦
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
@ayylmao123xdd thank you. I tried to follow the blog post and just changed from @ControllerAdvice to @RestControllerAdvice since ErrorMessage is just a custom type, I want to make use of problem details later on Still, doesn't work 😦
56 replies
JCHJava Community | Help. Code. Learn.
Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
would you mind telling me how to do this? ValidationExceptionHandler is wrong?
56 replies