{"action":"opened","issue":{"url":"https://api.github.com/repos/uber/thriftrw-python/issues/75","labels_url":"https://api.github.com/repos/uber/thriftrw-python/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/uber/thriftrw-python/issues/75/comments","events_url":"https://api.github.com/repos/uber/thriftrw-python/issues/75/events","html_url":"https://github.com/uber/thriftrw-python/issues/75","id":114868501,"number":75,"title":"Include-as syntax","user":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-03T17:35:13Z","updated_at":"2015-11-03T17:35:13Z","closed_at":null,"body":"When including other thrift file, the name of the reference in the thrift file is determined by the base name of the included file.\r\n\r\n    include \"foo/shared.thrift\"\r\n\r\nTypes defined in shared.thrift will be referenced via `shared`, like `shared.SomeType`.\r\n\r\nThis makes it impossible to include two files in different folders with the same base names.\r\n\r\n    include \"foo/shared.thrift\"\r\n    include \"bar/shared.thrift\"\r\n\r\nThe fix for this is to implement the include-as syntax we discussed previously.\r\n\r\n    include x \"foo/shared.thrift\"\r\n    include y \"bar/shared.thrift\"\r\n\r\nDefinitions inside foo/shared.thrift may now be referenced via `x.Something` and similarly, definitions in bar/shared.thrift may be referenced via `y.SomethingElse`.\r\n\r\n---\r\n\r\nNote that this is a change in syntax that will make Thrift files that use this incompatible with Apache Thrift."}}