{"action":"created","issue":{"url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/844","repository_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore","labels_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/844/labels{/name}","comments_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/844/comments","events_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/844/events","html_url":"https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/844","id":348433721,"node_id":"MDU6SXNzdWUzNDg0MzM3MjE=","number":844,"title":"Endpoint path does not include Base URL","user":{"login":"AnthonyMastrean","id":217842,"node_id":"MDQ6VXNlcjIxNzg0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/217842?v=4","gravatar_id":"","url":"https://api.github.com/users/AnthonyMastrean","html_url":"https://github.com/AnthonyMastrean","followers_url":"https://api.github.com/users/AnthonyMastrean/followers","following_url":"https://api.github.com/users/AnthonyMastrean/following{/other_user}","gists_url":"https://api.github.com/users/AnthonyMastrean/gists{/gist_id}","starred_url":"https://api.github.com/users/AnthonyMastrean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnthonyMastrean/subscriptions","organizations_url":"https://api.github.com/users/AnthonyMastrean/orgs","repos_url":"https://api.github.com/users/AnthonyMastrean/repos","events_url":"https://api.github.com/users/AnthonyMastrean/events{/privacy}","received_events_url":"https://api.github.com/users/AnthonyMastrean/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-07T18:20:05Z","updated_at":"2018-08-08T13:01:05Z","closed_at":"2018-08-07T22:18:43Z","author_association":"NONE","body":"We're running our app behind a reverse-proxy that inserts a prefix on all routes: `/api/`. We've got that wired up correctly using a preserialize filter and a custom X-Forwarded header.\r\n\r\n```csharp\r\napp.UseSwagger(options =>\r\n{\r\n    options.RouteTemplate = \"nvdm/api-docs/{documentName}/swagger.json\";\r\n    options.PreSerializeFilters.Add((doc, request) => doc.BasePath = request.Headers[\"X-Forwarded-Path\"]);\r\n});\r\n```\r\n\r\nYou can see Base URL under the first highlight on the screenshot. But, it's missing from the endpoint path under the second highlight. Although, it does appear properly in the Curl example!\r\n\r\n![image](https://user-images.githubusercontent.com/217842/43794103-57e11ac8-9a4b-11e8-9d7e-3e7bea636742.png)\r\n\r\nI assume Swashbuckle creates this `swagger.json` and you can see the \"paths\" appear absolute and are _missing_ the base path.\r\n\r\n```\r\n{\r\n    \"swagger\": \"2.0\",\r\n    \"info\": {\r\n        \"version\": \"v1\",\r\n        \"title\": \"NVDM API\"\r\n    },\r\n    \"basePath\": \"/api/\",\r\n    \"paths\": {\r\n        \"/nvdm/healthcheck\": {\r\n            \"get\": {\r\n                \"tags\": [\r\n                    \"Healthcheck\"\r\n                ],\r\n                \"summary\": \"Get the health of this service\",\r\n...\r\n```\r\n\r\nI don't see anything in the Swagger document model in the preserialize filters that I can set. Should Swashbuckle use the BasePath when constructing those paths?"},"comment":{"url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/comments/411396660","html_url":"https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/844#issuecomment-411396660","issue_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle.AspNetCore/issues/844","id":411396660,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTM5NjY2MA==","user":{"login":"AnthonyMastrean","id":217842,"node_id":"MDQ6VXNlcjIxNzg0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/217842?v=4","gravatar_id":"","url":"https://api.github.com/users/AnthonyMastrean","html_url":"https://github.com/AnthonyMastrean","followers_url":"https://api.github.com/users/AnthonyMastrean/followers","following_url":"https://api.github.com/users/AnthonyMastrean/following{/other_user}","gists_url":"https://api.github.com/users/AnthonyMastrean/gists{/gist_id}","starred_url":"https://api.github.com/users/AnthonyMastrean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnthonyMastrean/subscriptions","organizations_url":"https://api.github.com/users/AnthonyMastrean/orgs","repos_url":"https://api.github.com/users/AnthonyMastrean/repos","events_url":"https://api.github.com/users/AnthonyMastrean/events{/privacy}","received_events_url":"https://api.github.com/users/AnthonyMastrean/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T13:01:05Z","updated_at":"2018-08-08T13:01:05Z","author_association":"NONE","body":"That is an interesting historical artifact and a very specific point-of-view (a spec implementor or, at least, reader).\r\n\r\nI'm concerned about the use of the Swagger UI by regular users of my application! I expect them to practice in Swagger UI and turn around to do some very lite scripting or console `curl`ing without having to read the spec in order to construct the correct URL!\r\n\r\n@darrelmiller if there were a place to file a \"complaint\" or request to change this, would it be on the openapi-specification project?"}}
{"actor":{"display_login":"AnthonyMastrean"}}