{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4025","repository_url":"https://api.github.com/repos/swagger-api/swagger-ui","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4025/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4025/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4025/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/4025","id":281448455,"node_id":"MDU6SXNzdWUyODE0NDg0NTU=","number":4025,"title":"Path parameters are not url encoded","user":{"login":"pawanrao","id":5025638,"node_id":"MDQ6VXNlcjUwMjU2Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/5025638?v=4","gravatar_id":"","url":"https://api.github.com/users/pawanrao","html_url":"https://github.com/pawanrao","followers_url":"https://api.github.com/users/pawanrao/followers","following_url":"https://api.github.com/users/pawanrao/following{/other_user}","gists_url":"https://api.github.com/users/pawanrao/gists{/gist_id}","starred_url":"https://api.github.com/users/pawanrao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pawanrao/subscriptions","organizations_url":"https://api.github.com/users/pawanrao/orgs","repos_url":"https://api.github.com/users/pawanrao/repos","events_url":"https://api.github.com/users/pawanrao/events{/privacy}","received_events_url":"https://api.github.com/users/pawanrao/received_events","type":"User","site_admin":false},"labels":[{"id":183299655,"node_id":"MDU6TGFiZWwxODMyOTk2NTU=","url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/swagger-js","name":"swagger-js","color":"ccff75","default":false},{"id":46110653,"node_id":"MDU6TGFiZWw0NjExMDY1Mw==","url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/type:%20bug","name":"type: bug","color":"f9d0c4","default":false},{"id":565243947,"node_id":"MDU6TGFiZWw1NjUyNDM5NDc=","url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/version:%203.x","name":"version: 3.x","color":"f9f375","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-12T16:28:14Z","updated_at":"2018-09-07T23:12:14Z","closed_at":"2018-08-18T02:05:03Z","author_association":"NONE","body":"| Q                               | A\r\n| ------------------------------- | -------\r\n| Bug or feature request?         |  Bug\r\n| Which Swagger/OpenAPI version?  | 3.0\r\n| Which Swagger-UI version?       | 3.6.1\r\n| How did you install Swagger-UI? | Just Serving the `dist` directory\r\n| Which browser & version?        | Chrome\r\n| Which operating system?         | Windows\r\n\r\n\r\n### Demonstration API definition\r\n```yaml\r\nopenapi: 3.0.0\r\ninfo:\r\n  title: Test Service\r\n  version: 1.0.0\r\n  description: Swagger test service\r\nservers:\r\n  - url: 'https://testservice.swagger.io/services/docService'\r\npaths:\r\n  '/Docs/{docPath}':\r\n    get:\r\n      summary: Get the document JSON\r\n      tags:\r\n        - Document CRUD\r\n      parameters:\r\n        - in: path\r\n          name: docPath\r\n          description: Path for the document\r\n          required: true\r\n          schema:\r\n            type: string\r\n      responses:\r\n        '200':\r\n          description: OK\r\n        '404':\r\n          description: Document Not Found\r\n```\r\n### Expected Behavior\r\nReserved URL characters such as `/;` are not being URL-encoded.\r\nFor e.g if `docPath` above is `/home/foobar/baz.txt`, the `/` is not being encoded when I make the request using Try-It-Out->Execute button. \r\nI can replicate this in `editor.swagger.io` as well. \r\n\r\n### Current Behavior\r\nReserved characters should be URL-encoded. \r\nHowever this works with a Swagger 2.0 definition.\r\n\r\nPer my understanding, reserved characters should be url-encoded by default or am I missing anything in my definition?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/419589925","html_url":"https://github.com/swagger-api/swagger-ui/issues/4025#issuecomment-419589925","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4025","id":419589925,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTU4OTkyNQ==","user":{"login":"shockey","id":680248,"node_id":"MDQ6VXNlcjY4MDI0OA==","avatar_url":"https://avatars2.githubusercontent.com/u/680248?v=4","gravatar_id":"","url":"https://api.github.com/users/shockey","html_url":"https://github.com/shockey","followers_url":"https://api.github.com/users/shockey/followers","following_url":"https://api.github.com/users/shockey/following{/other_user}","gists_url":"https://api.github.com/users/shockey/gists{/gist_id}","starred_url":"https://api.github.com/users/shockey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shockey/subscriptions","organizations_url":"https://api.github.com/users/shockey/orgs","repos_url":"https://api.github.com/users/shockey/repos","events_url":"https://api.github.com/users/shockey/events{/privacy}","received_events_url":"https://api.github.com/users/shockey/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T23:12:14Z","updated_at":"2018-09-07T23:12:14Z","author_association":"MEMBER","body":"@rbjorklin, in this case we're bound by the specification to not allow this. As a rule, we don't skirt around the spec... from there, it's only a few steps to complete madness: what is a user to do when something works perfectly in Swagger UI but in no other tools, because the functionality is nonstandard?\r\n\r\nThe best thing you can do is raise an issue over at OpenAPI (https://github.com/OAI/OpenAPI-Specification/issues/new), to get this changed in the spec. Perhaps it'll be included in an upcoming version, and everyone can be happy!\r\n\r\nThat said, we live in the real world here too... so Swagger UI provides escape hatches you can use to implement this. This `requestInterceptor` should give you what you want:\r\n\r\n```js\r\n{\r\n  requestInterceptor: (request) => {\r\n    request.url = request.url.replace(/%2F/g, \"/\")\r\n    return request\r\n  }\r\n}\r\n```\r\n\r\nJust beware that you're going against the standard, and you shouldn't expect your definitions to work correctly in other Swagger/OpenAPI tools unless you customize them as well 😄 "}}
{"actor":{"display_login":"shockey"}}