{"action":"created","issue":{"url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/5","repository_url":"https://api.github.com/repos/LibrePCB/librepcb-api","labels_url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/5/comments","events_url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/5/events","html_url":"https://github.com/LibrePCB/librepcb-api/issues/5","id":316587195,"number":5,"title":"Take application version into account when delivering a list of libraries","user":{"login":"ubruhin","id":5374821,"avatar_url":"https://avatars1.githubusercontent.com/u/5374821?v=4","gravatar_id":"","url":"https://api.github.com/users/ubruhin","html_url":"https://github.com/ubruhin","followers_url":"https://api.github.com/users/ubruhin/followers","following_url":"https://api.github.com/users/ubruhin/following{/other_user}","gists_url":"https://api.github.com/users/ubruhin/gists{/gist_id}","starred_url":"https://api.github.com/users/ubruhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubruhin/subscriptions","organizations_url":"https://api.github.com/users/ubruhin/orgs","repos_url":"https://api.github.com/users/ubruhin/repos","events_url":"https://api.github.com/users/ubruhin/events{/privacy}","received_events_url":"https://api.github.com/users/ubruhin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-22T15:14:36Z","updated_at":"2018-05-22T17:17:45Z","closed_at":null,"author_association":"MEMBER","body":"Currently the API response of `/api/v1/libraries` contains all available libraries, no matter what file version they have. So if you use an older application version (e.g. with file format v0.1), you also get libraries with a newer file format (e.g. v0.2). But the application can't open these libraries because of the changed file format.\r\n\r\nSo the client (i.e. the application) needs to specify its version when asking the server for libraries. I think we can do this by using HTTP headers, for example:\r\n\r\n```\r\nX-LibrePCB-AppVersion: 0.1\r\nX-LibrePCB-AppGitHash: 0385957012d0a103fc56d08dd55fe0b7c466710f\r\n```\r\n\r\nWith this information, the server can filter out incompatible libraries in its response.\r\n\r\n@dbrgn Would you agree with that? Is this functionality supported by the Django REST Framework?"},"comment":{"url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/comments/391071129","html_url":"https://github.com/LibrePCB/librepcb-api/issues/5#issuecomment-391071129","issue_url":"https://api.github.com/repos/LibrePCB/librepcb-api/issues/5","id":391071129,"user":{"login":"ubruhin","id":5374821,"avatar_url":"https://avatars1.githubusercontent.com/u/5374821?v=4","gravatar_id":"","url":"https://api.github.com/users/ubruhin","html_url":"https://github.com/ubruhin","followers_url":"https://api.github.com/users/ubruhin/followers","following_url":"https://api.github.com/users/ubruhin/following{/other_user}","gists_url":"https://api.github.com/users/ubruhin/gists{/gist_id}","starred_url":"https://api.github.com/users/ubruhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubruhin/subscriptions","organizations_url":"https://api.github.com/users/ubruhin/orgs","repos_url":"https://api.github.com/users/ubruhin/repos","events_url":"https://api.github.com/users/ubruhin/events{/privacy}","received_events_url":"https://api.github.com/users/ubruhin/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T17:17:45Z","updated_at":"2018-05-22T17:17:45Z","author_association":"MEMBER","body":"> How would you handle uploading / contributing libraries with the static API?\r\n\r\nFor the official API (api.librepcb.org) we should of course use a dynamic API to support all features we want to have (like contributing). But there are situations where someone wants to use his own server, for example companies often want to use only their own libraries instead of publicly available libraries. In such situation a contributing feature might not be necessary, just fetching of libraries is needed. In that case a static API would be enough.\r\n\r\n> You always need a webserver to serve content over HTTP\r\n\r\nI think the API does not specify the protocol to use. just replace http:// by file:// and the json files are fetched directly from the local drive or a network share. I guess Qt supports that out of the box, it doesn't matter which protocol is used to fetch a file."}}
{"actor":{"display_login":"ubruhin"}}