rest icon indicating copy to clipboard operation
rest copied to clipboard

add WebTarget.queryParams(MultivaluedMap) into API

Open glassfishrobot opened this issue 12 years ago • 9 comments

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 avatar May 16 '13 00:05 glassfishrobot

  • Issue Imported From: https://github.com/jax-rs/api/issues/408
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

glassfishrobot avatar Feb 10 '18 21:02 glassfishrobot

@glassfishrobot Commented Reported by dkonecny

glassfishrobot avatar May 16 '13 00:05 glassfishrobot

@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 avatar May 16 '13 06:05 glassfishrobot

@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 avatar May 06 '16 16:05 glassfishrobot

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

glassfishrobot avatar Apr 25 '17 08:04 glassfishrobot

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

namedgraph avatar Mar 31 '20 09:03 namedgraph

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.

chkal avatar Mar 31 '20 14:03 chkal

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

namedgraph avatar Mar 31 '20 20:03 namedgraph

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.

chkal avatar Apr 01 '20 14:04 chkal