{"action":"opened","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3686","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3686/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3686/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3686/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3686","id":174328283,"number":3686,"title":"[Scala] Path parameters not handled correctly in Scalatra server","user":{"login":"jtnystrom","id":710364,"avatar_url":"https://avatars.githubusercontent.com/u/710364?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnystrom","html_url":"https://github.com/jtnystrom","followers_url":"https://api.github.com/users/jtnystrom/followers","following_url":"https://api.github.com/users/jtnystrom/following{/other_user}","gists_url":"https://api.github.com/users/jtnystrom/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnystrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnystrom/subscriptions","organizations_url":"https://api.github.com/users/jtnystrom/orgs","repos_url":"https://api.github.com/users/jtnystrom/repos","events_url":"https://api.github.com/users/jtnystrom/events{/privacy}","received_events_url":"https://api.github.com/users/jtnystrom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-31T17:11:19Z","updated_at":"2016-08-31T17:11:19Z","closed_at":null,"body":"\r\n##### Description\r\n\r\nPath parameters lead to generated code that produces exceptions at runtime.\r\nE.g. this kind of parameter:\r\n\r\n```\r\n/assays/{assayId}:\r\n  get:\r\n      summary: \"Information about a single assay.\"\r\n      parameters:\r\n        - name: assayId\r\n          in: path\r\n```\r\n\r\nProduces this code in the Scalatra server:\r\n`\r\n  get(\"/assays/{assayId}\",operation(assaysAssayIdGetOperation)) {\r\n\r\n`\r\n\r\nWhich gives this exception at runtime:\r\n\r\n```\r\njava.util.regex.PatternSyntaxException: Illegal repetition near index 8\r\n^/assays/{assayId}$\r\n        ^\r\n\tat java.util.regex.Pattern.error(Pattern.java:1955)\r\n\tat java.util.regex.Pattern.closure(Pattern.java:3157)\r\n\tat java.util.regex.Pattern.sequence(Pattern.java:2134)\r\n\tat java.util.regex.Pattern.expr(Pattern.java:1996)\r\n\tat java.util.regex.Pattern.compile(Pattern.java:1696)\r\n\tat java.util.regex.Pattern.<init>(Pattern.java:1351)\r\n\tat java.util.regex.Pattern.compile(Pattern.java:1028)\r\n\tat scala.util.matching.Regex.<init>(Regex.scala:191)\r\n\tat scala.collection.immutable.StringLike$class.r(StringLike.scala:255)\r\n\tat scala.collection.immutable.StringOps.r(StringOps.scala:29)\r\n\tat scala.collection.immutable.StringLike$class.r(StringLike.scala:244)\r\n\tat scala.collection.immutable.StringOps.r(StringOps.scala:29)\r\n\tat org.scalatra.RegexPathPatternParser$PartialPathPattern.toPathPattern(pathPatternParsers.scala:53)\r\n\tat org.scalatra.SinatraPathPatternParser.apply(pathPatternParsers.scala:69)\r\n\r\n```\r\n\r\nThe correct generated code, to avoid this exception, is probably:\r\n\r\n```\r\n  get(\"/assays/:assayId\",operation(assaysAssayIdGetOperation)) {\r\n\r\n```\r\n\r\nThis is in the latest snapshot from GitHub."}}
{"actor":{"display_login":"jtnystrom"}}