Posts about Quarkus
Quarkus uses Hibernate Validator for validation. This means that the correct way to do custom field validation is to create a custom constraint. The steps to do this are well documented. However, since I am still learning Kotlin, it was not trivial for me to convert the sample code to Kotlin, especially the annotation part.
Validation in Quarkus is based on the Hibernate Validator. Annotations are the preferred way for adding constraints. Unfortunately, this approach cannot be used if you generate your model classes from an OpenAPI specification.
Quarkus has extensive built-in support for validation with Hibernate Validator. You just need to add some annotations to your models and your endpoint for Quarkus to return a 400 response listing the detected constraint violations. But what if you want to modify or even localize this response?
It is not too uncommon that REST responses have to be localized because they are displayed directly in the user interface. However, I could not find an example of this in the Quarkus documentation. Localization is only mentioned in the context of data validation and the approach used there isn't applicable to other use cases.
Mapped Diagnostic Context (MDC) can be very useful to enrich log messages with correlation information. Unfortunately, the Quarkus logging documentation does not say much about it. I could only find it mentioned among the logging format patterns. Still, it seems to be well supported according to a GitHub issue I found.