jakartaee / rest

Jakarta RESTful Web Services
Other
362 stars 117 forks source link

add WebTarget.queryParams(MultivaluedMap) into API #408

Open glassfishrobot opened 11 years ago

glassfishrobot commented 11 years ago

Prior to JAX-RS 2.0 the Jersey had a method which accepted MultivaluedMap which allowed to write most of the code in single line, eg:

return target.queryParam("api_sig", signature). queryParams(getQueryOrFormParams(queryParamNames, queryParamValues)). // getQueryOrFormParams returns MultivaluedMap queryParams(getQParams(optionalQueryParams)). // getQParams returns MultivaluedMap accept(javax.ws.rs.core.MediaType.TEXT_XML). get(responseType);

In JAX-RS 2.0 above code needs to be rewritten using iteration over array and calling WebTarget.queryParam(key, values)

Environment

any

Affected Versions

[2.0]

glassfishrobot commented 6 years ago
glassfishrobot commented 11 years ago

@glassfishrobot Commented Reported by dkonecny

glassfishrobot commented 11 years ago

@glassfishrobot Commented geertjan said: I agree, this would be very useful, because JAX-RS 2.0 should ideally be at least as good (preferably better) than Jersey.

glassfishrobot commented 8 years ago

@glassfishrobot Commented philipcrow said: Agree. Would be an appreciated improvement to have WebTarget.queryParams(MultivaluedMap).

Has been mentioned on StackOverflow with other users wanting that function here: http://stackoverflow.com/q/29409950/977087

Jersey current version is at 2.22.2

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JAX_RS_SPEC-403

namedgraph commented 4 years ago

What's the status of this? How hard can it be to add a single method?

chkal commented 4 years ago

Feel free to provide a pull request for this. :-)

But please note that such a change may also require changes to the spec document, the TCK and maybe even more.

namedgraph commented 4 years ago

Why did it have to be removed in the first place? It exists in 1.9, and 2.x still supports MultivaluedMap.

chkal commented 4 years ago

I don't know about the details. But it wasn't actually "removed". It just wasn't part of the new JAX-RS API which was defined back then and which was heavily inspired by the Jersey implementation.