{"action":"created","issue":{"url":"https://api.github.com/repos/netguru/ResponseDetective/issues/42","repository_url":"https://api.github.com/repos/netguru/ResponseDetective","labels_url":"https://api.github.com/repos/netguru/ResponseDetective/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/netguru/ResponseDetective/issues/42/comments","events_url":"https://api.github.com/repos/netguru/ResponseDetective/issues/42/events","html_url":"https://github.com/netguru/ResponseDetective/issues/42","id":251309647,"number":42,"title":"Hide Objective-C nature of XML and HTML body deserializers","user":{"login":"akashivskyy","id":565231,"avatar_url":"https://avatars2.githubusercontent.com/u/565231?v=4","gravatar_id":"","url":"https://api.github.com/users/akashivskyy","html_url":"https://github.com/akashivskyy","followers_url":"https://api.github.com/users/akashivskyy/followers","following_url":"https://api.github.com/users/akashivskyy/following{/other_user}","gists_url":"https://api.github.com/users/akashivskyy/gists{/gist_id}","starred_url":"https://api.github.com/users/akashivskyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akashivskyy/subscriptions","organizations_url":"https://api.github.com/users/akashivskyy/orgs","repos_url":"https://api.github.com/users/akashivskyy/repos","events_url":"https://api.github.com/users/akashivskyy/events{/privacy}","received_events_url":"https://api.github.com/users/akashivskyy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/netguru/ResponseDetective/milestones/2","html_url":"https://github.com/netguru/ResponseDetective/milestone/2","labels_url":"https://api.github.com/repos/netguru/ResponseDetective/milestones/2/labels","id":2512678,"number":2,"title":"2.0","description":"Tracks ResponseDetective 2.0 progress.","creator":{"login":"akashivskyy","id":565231,"avatar_url":"https://avatars2.githubusercontent.com/u/565231?v=4","gravatar_id":"","url":"https://api.github.com/users/akashivskyy","html_url":"https://github.com/akashivskyy","followers_url":"https://api.github.com/users/akashivskyy/followers","following_url":"https://api.github.com/users/akashivskyy/following{/other_user}","gists_url":"https://api.github.com/users/akashivskyy/gists{/gist_id}","starred_url":"https://api.github.com/users/akashivskyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akashivskyy/subscriptions","organizations_url":"https://api.github.com/users/akashivskyy/orgs","repos_url":"https://api.github.com/users/akashivskyy/repos","events_url":"https://api.github.com/users/akashivskyy/events{/privacy}","received_events_url":"https://api.github.com/users/akashivskyy/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":2,"state":"open","created_at":"2017-05-10T13:28:54Z","updated_at":"2017-12-14T09:53:10Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-08-18T17:27:27Z","updated_at":"2018-02-02T22:26:53Z","closed_at":null,"author_association":"MEMBER","body":"As libxml cannot be imported to Swift directly, ResponseDetective currently uses `RDTBodyDeserializer`, `RDTXMLBodyDeserializer` and `RDTHTMLBodyDeserializer` types, thus making its unwanted Objective-C nature public.\r\n\r\nIdeally, I'd like to remove all traces of Objective-C files from the project. This could be achieved in a couple of ways:\r\n\r\n1. Use an Objective-C libxml wrapper as an external framework and import it directly in Swift. This is the worst solution because it adds an unwanted third-party dependency to ResponseDetective.\r\n\r\n2. Create a project-private libxml wrapper as a separate framework and import it directly in Swift. This is better than the 1st solution, but adds a lot of unwanted complexity, especially with header search paths, linking and module maps.\r\n\r\n3. Use a project-private module (not to be mistaken with framework) that exposes needed libxml functionalities internally to ResponseDetective, but no further. This is the best solution.\r\n\r\nAssuming the 3rd solution is chosen, the proposed implementation would consist of the following files:\r\n\r\n- A `.m` file that uses libxml and contains implementation of XML and HTML pretty-printing,\r\n- A non-public `.h` file that contains interface of above implementation,\r\n- A `.modulemap` file that defines a module including the above header.\r\n\r\nAs a result, ResponseDetective could `import XMLPrettyPrinting` (exemplary name of module) directly and use refined-for-Swift APIs without them leaking to the outside world."},"comment":{"url":"https://api.github.com/repos/netguru/ResponseDetective/issues/comments/362726220","html_url":"https://github.com/netguru/ResponseDetective/issues/42#issuecomment-362726220","issue_url":"https://api.github.com/repos/netguru/ResponseDetective/issues/42","id":362726220,"user":{"login":"akashivskyy","id":565231,"avatar_url":"https://avatars2.githubusercontent.com/u/565231?v=4","gravatar_id":"","url":"https://api.github.com/users/akashivskyy","html_url":"https://github.com/akashivskyy","followers_url":"https://api.github.com/users/akashivskyy/followers","following_url":"https://api.github.com/users/akashivskyy/following{/other_user}","gists_url":"https://api.github.com/users/akashivskyy/gists{/gist_id}","starred_url":"https://api.github.com/users/akashivskyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akashivskyy/subscriptions","organizations_url":"https://api.github.com/users/akashivskyy/orgs","repos_url":"https://api.github.com/users/akashivskyy/repos","events_url":"https://api.github.com/users/akashivskyy/events{/privacy}","received_events_url":"https://api.github.com/users/akashivskyy/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T22:26:53Z","updated_at":"2018-02-02T22:26:53Z","author_association":"MEMBER","body":"Well, it looks like Xcode 9.3 fixed this for us – `libxml2` is now a **module**, which means we can do straight `import libxml2` in Swift. 🎉 "}}
{"actor":{"display_login":"akashivskyy"}}