{"action":"created","issue":{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/169","repository_url":"https://api.github.com/repos/OAI/OpenAPI-Specification","labels_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/169/comments","events_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/169/events","html_url":"https://github.com/OAI/OpenAPI-Specification/issues/169","id":46554374,"number":169,"title":"Why don't host and basePath support path templating?","user":{"login":"maxlinc","id":896878,"avatar_url":"https://avatars.githubusercontent.com/u/896878?v=3","gravatar_id":"","url":"https://api.github.com/users/maxlinc","html_url":"https://github.com/maxlinc","followers_url":"https://api.github.com/users/maxlinc/followers","following_url":"https://api.github.com/users/maxlinc/following{/other_user}","gists_url":"https://api.github.com/users/maxlinc/gists{/gist_id}","starred_url":"https://api.github.com/users/maxlinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxlinc/subscriptions","organizations_url":"https://api.github.com/users/maxlinc/orgs","repos_url":"https://api.github.com/users/maxlinc/repos","events_url":"https://api.github.com/users/maxlinc/events{/privacy}","received_events_url":"https://api.github.com/users/maxlinc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/labels/OpenAPI.Next%20Proposal","name":"OpenAPI.Next Proposal","color":"207de5"},{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/labels/Sub%20Issue","name":"Sub Issue","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2014-10-22T20:09:03Z","updated_at":"2016-08-20T14:45:09Z","closed_at":null,"body":"The Swagger 2 schema says that neither host nor basePath support path templating. We probalby discussed this but I don't remember the exact reason and it seems like a big limitation. It's common to have parameters in either the host or in the basePath. You can at least work around the basePath limitation with excessively long paths, but there is no workaround for parameter in a host. Swagger will force you to hardcode a value.\r\n\r\nReal-world examples:\r\n- Host parameter:\r\n    - [Rackspace](http://api.rackspace.com/): `https://{data_center}.servers.api.rackspacecloud.com/v2/{account_id}`\r\n    - [Okta](http://developer.okta.com/docs/getting_started/design_principles.html): `https://{your_company}.okta.com/api/v1/apps/{app_id}`\r\n    - [Zendesk](https://developer.zendesk.com/rest_api/docs/core/organizations): `https://{subdomain}.zendesk.com/api/v2/organizations.json`\r\n- basePath parameter\r\n    - [Apigee](http://apigee.com/docs/management/apis/get/organizations/%7Borg_name%7D): `https://api.enterprise.apigee.com/v1/organizations/{org_name}/apis`\r\n    - [Heroku](https://devcenter.heroku.com/articles/platform-api-reference): `https://api.heroku.com/apps/{app_id}/addons`\r\n\r\nI think the reason may have been just:\r\n\r\n- We didn't have a plan for global parameters (though we do define *available* global parameters which is likely good enough, because using a parameter in a host or basePath template could imply or require a $ref to the parameter name)\r\n- We just didn't have enough time to put together a sample and tests before Swagger 2 was released\r\n\r\nIt's also worth noting that neither host nor basePath are required, nor are they required to resolve to the actual API (e.g. you could set your host to `example.com`).\r\n\r\nI'm hoping to at least get support targeted for the next spec, if not an update to this spec clarifying that host/basePath templating is not required but may be supported by some projects."},"comment":{"url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/comments/241203970","html_url":"https://github.com/OAI/OpenAPI-Specification/issues/169#issuecomment-241203970","issue_url":"https://api.github.com/repos/OAI/OpenAPI-Specification/issues/169","id":241203970,"user":{"login":"n-sviridenko","id":9335422,"avatar_url":"https://avatars.githubusercontent.com/u/9335422?v=3","gravatar_id":"","url":"https://api.github.com/users/n-sviridenko","html_url":"https://github.com/n-sviridenko","followers_url":"https://api.github.com/users/n-sviridenko/followers","following_url":"https://api.github.com/users/n-sviridenko/following{/other_user}","gists_url":"https://api.github.com/users/n-sviridenko/gists{/gist_id}","starred_url":"https://api.github.com/users/n-sviridenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-sviridenko/subscriptions","organizations_url":"https://api.github.com/users/n-sviridenko/orgs","repos_url":"https://api.github.com/users/n-sviridenko/repos","events_url":"https://api.github.com/users/n-sviridenko/events{/privacy}","received_events_url":"https://api.github.com/users/n-sviridenko/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T14:45:09Z","updated_at":"2016-08-20T14:45:09Z","body":"+1"}}
{"actor":{"display_login":"n-sviridenko"}}