Skip to content

ENH: [Client generator] Add Map<String,?> option for header() queryParam() and formParam() #62

Closed
@rbygrave

Description

@rbygrave

With this we can use Map<String, ?> parameter types for @QueryParam, @Header and @FormParam and these are then passed as a map to the set multiple query parameters, headers, or form parameters.

Example

  @Get("{uid}/withParams")
  HttpResponse<String> withParams(long uid, @QueryParam Map<String, ?> params);

Generates the code below ...

  // GET {uid}/withParams
  @Override
  public HttpResponse<String> withParams(long uid, Map<String,?> params) {
    return clientContext.request()
      .path("moo").path(uid).path("withParams")
      .queryParam(params)
      .GET()
      .asString();
  }

Note that the .queryParam(params) sets the map of query parameters to the request.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions