Oracle 23ai still doesn't support the standard SQL FILTER clause on aggregate functions, which can prove to be tricky to emulate on JSON aggregate functions| Java, SQL and jOOQ.
Getting top 1 per group values is a bit tricky in SQL in general. This post explains how to do this with Oracle when multiple values per group are requested| Java, SQL and jOOQ.