{"action":"closed","issue":{"url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/issues/154","repository_url":"https://api.github.com/repos/awslabs/aws-serverless-java-container","labels_url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/issues/154/comments","events_url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/issues/154/events","html_url":"https://github.com/awslabs/aws-serverless-java-container/issues/154","id":330408867,"node_id":"MDU6SXNzdWUzMzA0MDg4Njc=","number":154,"title":"JSON String as a Query Parameter throws error","user":{"login":"aldilaff","id":6405163,"node_id":"MDQ6VXNlcjY0MDUxNjM=","avatar_url":"https://avatars3.githubusercontent.com/u/6405163?v=4","gravatar_id":"","url":"https://api.github.com/users/aldilaff","html_url":"https://github.com/aldilaff","followers_url":"https://api.github.com/users/aldilaff/followers","following_url":"https://api.github.com/users/aldilaff/following{/other_user}","gists_url":"https://api.github.com/users/aldilaff/gists{/gist_id}","starred_url":"https://api.github.com/users/aldilaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldilaff/subscriptions","organizations_url":"https://api.github.com/users/aldilaff/orgs","repos_url":"https://api.github.com/users/aldilaff/repos","events_url":"https://api.github.com/users/aldilaff/events{/privacy}","received_events_url":"https://api.github.com/users/aldilaff/received_events","type":"User","site_admin":false},"labels":[{"id":495041084,"node_id":"MDU6TGFiZWw0OTUwNDEwODQ=","url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"SAPessi","id":2996317,"node_id":"MDQ6VXNlcjI5OTYzMTc=","avatar_url":"https://avatars0.githubusercontent.com/u/2996317?v=4","gravatar_id":"","url":"https://api.github.com/users/SAPessi","html_url":"https://github.com/SAPessi","followers_url":"https://api.github.com/users/SAPessi/followers","following_url":"https://api.github.com/users/SAPessi/following{/other_user}","gists_url":"https://api.github.com/users/SAPessi/gists{/gist_id}","starred_url":"https://api.github.com/users/SAPessi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SAPessi/subscriptions","organizations_url":"https://api.github.com/users/SAPessi/orgs","repos_url":"https://api.github.com/users/SAPessi/repos","events_url":"https://api.github.com/users/SAPessi/events{/privacy}","received_events_url":"https://api.github.com/users/SAPessi/received_events","type":"User","site_admin":false},"assignees":[{"login":"SAPessi","id":2996317,"node_id":"MDQ6VXNlcjI5OTYzMTc=","avatar_url":"https://avatars0.githubusercontent.com/u/2996317?v=4","gravatar_id":"","url":"https://api.github.com/users/SAPessi","html_url":"https://github.com/SAPessi","followers_url":"https://api.github.com/users/SAPessi/followers","following_url":"https://api.github.com/users/SAPessi/following{/other_user}","gists_url":"https://api.github.com/users/SAPessi/gists{/gist_id}","starred_url":"https://api.github.com/users/SAPessi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SAPessi/subscriptions","organizations_url":"https://api.github.com/users/SAPessi/orgs","repos_url":"https://api.github.com/users/SAPessi/repos","events_url":"https://api.github.com/users/SAPessi/events{/privacy}","received_events_url":"https://api.github.com/users/SAPessi/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/milestones/11","html_url":"https://github.com/awslabs/aws-serverless-java-container/milestone/11","labels_url":"https://api.github.com/repos/awslabs/aws-serverless-java-container/milestones/11/labels","id":3248515,"node_id":"MDk6TWlsZXN0b25lMzI0ODUxNQ==","number":11,"title":"Release 1.1.1","description":"","creator":{"login":"SAPessi","id":2996317,"node_id":"MDQ6VXNlcjI5OTYzMTc=","avatar_url":"https://avatars0.githubusercontent.com/u/2996317?v=4","gravatar_id":"","url":"https://api.github.com/users/SAPessi","html_url":"https://github.com/SAPessi","followers_url":"https://api.github.com/users/SAPessi/followers","following_url":"https://api.github.com/users/SAPessi/following{/other_user}","gists_url":"https://api.github.com/users/SAPessi/gists{/gist_id}","starred_url":"https://api.github.com/users/SAPessi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SAPessi/subscriptions","organizations_url":"https://api.github.com/users/SAPessi/orgs","repos_url":"https://api.github.com/users/SAPessi/repos","events_url":"https://api.github.com/users/SAPessi/events{/privacy}","received_events_url":"https://api.github.com/users/SAPessi/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":6,"state":"open","created_at":"2018-04-06T17:53:14Z","updated_at":"2018-06-20T22:03:06Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2018-06-07T19:41:04Z","updated_at":"2018-06-20T22:03:06Z","closed_at":"2018-06-20T22:03:06Z","author_association":"NONE","body":"* Framework version: 1.1\r\n* Implementations: Jersey \r\n\r\n## Scenario\r\n\r\nI have a GET endpoint that takes in a String query parameter:\r\n```java\r\n\r\n @GET\r\n    @Path(\"/search\")\r\n    @Produces(MediaType.APPLICATION_JSON)\r\n    public Response list(@QueryParam(\"query\") String queryStr) throws IOException {\r\n        Map<String, String> response = new HashMap<>();\r\n        response.put(\"body\", queryStr);\r\n        return Response.status(200).entity(response).build();\r\n    }\r\n}\r\n```\r\nWhen the endpoint is called with a simple string as a parameter it works as expected. For example `.../search?query=helloWorld` would work as expected. However, when the function is called with a JSON string as a parameter I am seeing an IllegalArgumentException. Making this call `.../search?query={\"name\":\"faisal\"}` would throw this error:\r\n\r\n```\r\njava.lang.IllegalArgumentException: Illegal character \"\"\" at position 7 is not allowed as a start of a name in a path template \"query={\"name\":\"faisal\"}\".\r\n```\r\n## Expected behavior\r\nThe JSON string should be parsed as a string.\r\n\r\n## Actual behavior\r\nThe JSON string causes an IllegalArgumentException.\r\n\r\n## Steps to reproduce\r\n\r\n1. Define a GET endpoint that takes in a string as a query parameter\r\n2. Call endpoint with the parameter set to a JSON string.\r\n\r\n## Full log output\r\n```\r\n4310 [main] ERROR com.amazonaws.serverless.proxy.internal.LambdaContainerHandler - Error while handling request\r\njava.lang.IllegalArgumentException: Illegal character \"\"\" at position 7 is not allowed as a start of a name in a path template \"query={\"name\":\"faisal\"}\".\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parseName(UriTemplateParser.java:331)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:256)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:115)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:1004)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:970)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:906)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:871)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:914)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder.build(JerseyUriBuilder.java:831)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.servletRequestToContainerRequest(JerseyHandlerFilter.java:141)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.doFilter(JerseyHandlerFilter.java:86)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.FilterChainHolder.doFilter(FilterChainHolder.java:84)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.AwsLambdaServletContainerHandler.doFilter(AwsLambdaServletContainerHandler.java:207)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:171)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:75)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxy(LambdaContainerHandler.java:168)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxyStream(LambdaContainerHandler.java:200)\r\n\tat com.lithium.tocoma.reach.handlers.AssetHandler.handleRequest(AssetHandler.java:23)\r\n\tat lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888)\r\n\tat lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283)\r\n\tat lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64)\r\n\tat java.lang.Class.forName0(Native Method)\r\n\tat java.lang.Class.forName(Class.java:348)\r\n\tat lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)\r\n4316 [main] ERROR com.amazonaws.serverless.proxy.AwsProxyExceptionHandler - Called exception handler for:\r\njava.lang.IllegalArgumentException: Illegal character \"\"\" at position 7 is not allowed as a start of a name in a path template \"query={\"name\":\"faisal\"}\".\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parseName(UriTemplateParser.java:331)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:256)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:115)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:1004)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:970)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:906)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:871)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:914)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder.build(JerseyUriBuilder.java:831)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.servletRequestToContainerRequest(JerseyHandlerFilter.java:141)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.doFilter(JerseyHandlerFilter.java:86)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.FilterChainHolder.doFilter(FilterChainHolder.java:84)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.AwsLambdaServletContainerHandler.doFilter(AwsLambdaServletContainerHandler.java:207)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:171)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:75)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxy(LambdaContainerHandler.java:168)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxyStream(LambdaContainerHandler.java:200)\r\n\tat com.lithium.tocoma.reach.handlers.AssetHandler.handleRequest(AssetHandler.java:23)\r\n\tat lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888)\r\n\tat lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283)\r\n\tat lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64)\r\n\tat java.lang.Class.forName0(Native Method)\r\n\tat java.lang.Class.forName(Class.java:348)\r\n\tat lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)\r\njava.lang.IllegalArgumentException: Illegal character \"\"\" at position 7 is not allowed as a start of a name in a path template \"query={\"name\":\"faisal\"}\".\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parseName(UriTemplateParser.java:331)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:256)\r\n\tat org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:115)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:1004)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:970)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:906)\r\n\tat org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:871)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:914)\r\n\tat org.glassfish.jersey.uri.internal.JerseyUriBuilder.build(JerseyUriBuilder.java:831)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.servletRequestToContainerRequest(JerseyHandlerFilter.java:141)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter.doFilter(JerseyHandlerFilter.java:86)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.FilterChainHolder.doFilter(FilterChainHolder.java:84)\r\n\tat com.amazonaws.serverless.proxy.internal.servlet.AwsLambdaServletContainerHandler.doFilter(AwsLambdaServletContainerHandler.java:207)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:171)\r\n\tat com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler.handleRequest(JerseyLambdaContainerHandler.java:75)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxy(LambdaContainerHandler.java:168)\r\n\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxyStream(LambdaContainerHandler.java:200)\r\n\tat com.lithium.tocoma.reach.handlers.AssetHandler.handleRequest(AssetHandler.java:23)\r\n\tat lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888)\r\n\tat lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283)\r\n\tat lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64)\r\n\tat java.lang.Class.forName0(Native Method)\r\n\tat java.lang.Class.forName(Class.java:348)\r\n\tat lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)\r\n```"}}
{"actor":{"display_login":"SAPessi"}}