Как получить URL-адрес GitHub из идентификатора проблемы? - PullRequest
0 голосов
/ 24 мая 2018

Я создаю приложение Github Issues, в котором после отображения списка проблем определенного репо я хочу нажать на одну проблему и перейти на страницу сведений о проблеме.

Итак, я передаю {issue.id} через параметры маршрута.Теперь для выполнения axios GET-запроса на получение сведений, я хочу получить url этой конкретной проблемы по указанному идентификатору?

Может кто-нибудь помочь, пожалуйста?

1 Ответ

0 голосов
/ 24 мая 2018

Пожалуйста, проверьте этот URL:

https://developer.github.com/v3/issues/#list-issues

Example:

https://api.github.com/repos/octocat/Hello-World/issues

https://api.github.com/repos/octocat/Hello-World/issues{/number}



Hope this helps.

Пример ответа:

[
  {
    "url": "https://api.github.com/repos/octocat/Hello-World/issues/404",
    "repository_url": "https://api.github.com/repos/octocat/Hello-World",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/labels{/name}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/comments",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/events",
    "html_url": "https://github.com/octocat/Hello-World/issues/404",
    "id": 322291044,
    "number": 404,
    "title": "Internationalization",
    "user": {
      "login": "dgruntz",
      "id": 1516800,
      "avatar_url": "https://avatars0.githubusercontent.com/u/1516800?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/dgruntz",
      "html_url": "https://github.com/dgruntz",
      "followers_url": "https://api.github.com/users/dgruntz/followers",
      "following_url": "https://api.github.com/users/dgruntz/following{/other_user}",
      "gists_url": "https://api.github.com/users/dgruntz/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/dgruntz/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/dgruntz/subscriptions",
      "organizations_url": "https://api.github.com/users/dgruntz/orgs",
      "repos_url": "https://api.github.com/users/dgruntz/repos",
      "events_url": "https://api.github.com/users/dgruntz/events{/privacy}",
      "received_events_url": "https://api.github.com/users/dgruntz/received_events",
      "type": "User",
      "site_admin": false
    },
    "labels": [

    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "assignees": [

    ],
    "milestone": null,
    "comments": 0,
    "created_at": "2018-05-11T13:11:00Z",
    "updated_at": "2018-05-11T13:11:00Z",
    "closed_at": null,
    "author_association": "NONE",
    "body": "I miss internationalization support for this project. Will that ever be added?"
  } ]
...