micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.09k stars 1.07k forks source link

Query array arguments type conversion does not work after migrating to Micronaut 4.2.x from 3.8.x #10406

Closed VitaliPareika closed 10 months ago

VitaliPareika commented 10 months ago

Expected Behavior

@Client(value = "${server.url}", alpnModes = HttpVersionSelection.ALPN_HTTP_2) public interface SomeClient {

@Get("/v2/invoices?sort[]=updated_time.desc&page_size=20")
HttpResponse<InvoicesResponse> getInvoicesByUpdateTime(@QueryValue("filter[]") String[] filter);

}

When calling this client method with argument String[] filter = ["state.EQ:posted", "account_id.EQ:123"] I would expect the following query value should be added to result query as: '&filter[]=state.EQ:posted,account_id.EQ:123'. Filter elements separated by comma in the query and this works fine when using Micronaut 3.8.x and Amazon Corretto 11

Actual Behaviour

@Client(value = "${server.url}", alpnModes = HttpVersionSelection.ALPN_HTTP_2) public interface SomeClient {

@Get("/v2/invoices?sort[]=updated_time.desc&page_size=20")
HttpResponse<InvoicesResponse> getInvoicesByUpdateTime(@QueryValue("filter[]") String[] filter);

}

When calling this client method with argument String[] filter = ["state.EQ:posted", "account_id.EQ:123"] the following query value is added to result query as: '&filter[]=state.EQ:postedaccount_id.EQ:123'. Filter elements not separated by comma in the query when using Micronaut 4.2.x and Amazon Corretto 17

When I've used List instead of String[] filter elements are separated by comma in the query.

Steps To Reproduce

Environment Information

Example Application

No response

Version

4.2.1

VitaliPareika commented 10 months ago

micronaut_3 8 12 micronaut_4 2 1

VitaliPareika commented 10 months ago

Not a bug. It's our codebase issue.