2

In javascript I am encoding the path and attaching to URL. In GET call REST URL is truncated after the semicolon.

path name : !#;@$^&()_+{}:,.'[]

encodeURI(path name) : %21%23%3B%40%24%5E%26%28%29_%2B%7B%7D%3A%2C.%27%5B%5D

URL+path : ../reports/SMC-%21%23%3B%40%24%5E%26%28%29_%2B%7B%7D%3A%2C.%27%5B%5D/configs?_=1482329220060

@GET
    @Path("/{report_name}/configs")
    @Produces({ MediaType.APPLICATION_JSON })
    @ApiOperation(value = "Fetches the configurations of the report",httpMethod = HttpMethod.GET, response = ReportConfigOptions.class)
    public Response getAllConfigOptions(@PathParam("report_name") String fqReportName,
            @QueryParam("context_parameters") ReportContextParameters contextParameters,
            @QueryParam("apply_locale") boolean applyLocale) {
@PathParam("report_name") String fqReportName 
....

fqReportName will be trancated after semicolon (;) fqReportName : !#

is it possible to prevent this trancation?

1 Answers1

0

Problem is that jersy is considering ; as Matrix parameter indication. see this answer: How can I map semicolon-separated PathParams in Jersey?

EDIT:

This has worked for me:

@GET
@Path("s/{s: .*}")
@Produces("application/json")
public Response s(@PathParam("s") String s){
    return Response.ok(s).build();

}

You might need to refine your regex not to include "/" since you have a second path segment after the path param.

Community
  • 1
  • 1
galusben
  • 5,948
  • 6
  • 33
  • 52