LocalDateWithInfinitySerializer
Writes a LocalDate the way a date column holds it, so that (payload->>'until')::date reads back what was put in.
Two things stand between the default serializer and that. LocalDate.Companion.DISTANT_FUTURE and LocalDate.Companion.DISTANT_PAST mean PostgreSQL's infinity and -infinity in a column and are written out as year ±999999999 in JSON - a year no date holds, and not infinity in any case, so the same Kotlin value stops meaning the same thing depending on where it is stored. And every year outside 0001..9999 is spelled in a way PostgreSQL will not read at all; see PgDateText for that half, which is a plain LocalDate(10000, …) and not a marker.
Registered contextually by octaviusSerializersModule; @Contextual on the property is what selects it.