20/01/2025 - LucaDev ha scritto:
tuttavia questa API, l'array rrIntervals lo deve ricevere da postman,
solo che non ho idea di come passare un array in query string
Il passaggio in query string con rrIntervals=nnn,mmm,xxx è già corretto ed appropriato per un double[] con @RequestParam. Quello che manca è che dovresti sempre esplicitare il value del @RequestParam ovvero:
@RequestParam("rrIntervals") double[] rrIntervals
L'introspezione per usare implicitamente il nome del parametro formale (cioè double[] rrIntervals) è possibile ma solo a determinate condizioni. Da documentazione Spring URI patterns:
You can explicitly name URI variables (for example, @PathVariable("customId")), but you can leave that detail out if the names are the same and your code is compiled with debugging information or with the -parameters compiler flag on Java 8.