KnpLabs / KnpLabs/php-github-api

RequestInterface shows invalid URI

Aperta
#611 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
PHP
Stelle
2.2k
Fork
585
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm, always getting the "Not found" error on my api calls. Tried investigating and found this on the $request passed to the RequestInterface::sendRequest() method:

Request {#346 ▼
  -method: "GET"
  -requestTarget: null
  -uri: Uri {#347 ▼
    -scheme: ""
    -userInfo: ""
    -host: ""
    -port: null
    -path: "/user/repos"
    -query: "type=owner&sort=full_name&direction=asc"
    -fragment: ""
  }
  -headers: []
  -headerNames: []
  -protocol: "1.1"
  -stream: null
}

Seems like the path parameter is missing some parameters even though $github->currentUser()->show() shows a complete response:

array:30 [▼
  "login" => "myusername"
  "id" => xxxxxxxxx
  "avatar_url" => "https://avatars2.githubusercontent.com/u/xxxxxxxxx?v=3"
  "gravatar_id" => ""
  "url" => "https://api.github.com/users/myusername"
  "html_url" => "https://github.com/myusername"
  "followers_url" => "https://api.github.com/users/myusername/followers"
  "following_url" => "https://api.github.com/users/myusername/following{/other_user}"
  "gists_url" => "https://api.github.com/users/myusername/gists{/gist_id}"
  "starred_url" => "https://api.github.com/users/myusername/starred{/owner}{/repo}"
  "subscriptions_url" => "https://api.github.com/users/myusername/subscriptions"
  "organizations_url" => "https://api.github.com/users/myusername/orgs"
  "repos_url" => "https://api.github.com/users/myusername/repos"
  "events_url" => "https://api.github.com/users/myusername/events{/privacy}"
  "received_events_url" => "https://api.github.com/users/myusername/received_events"
  "type" => "User"
  "site_admin" => false
  "name" => "My Name"
  "company" => null
  "blog" => "http://www.myusername.com"
  "location" => null
  "email" => "myusername@gmail.com"
  "hireable" => true
  "bio" => null
  "public_repos" => 4
  "public_gists" => 0
  "followers" => 0
  "following" => 0
  "created_at" => "2013-03-05T03:52:44Z"
  "updated_at" => "2017-06-28T06:59:13Z"
]

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da RequestInterface::sendRequest() e verifica come vengono assemblati i valori Request e Uri mostrati nel report per la chiamata user-repositories. Riproduci la richiesta API e confronta l’URI risultante con l’endpoint rappresentato dalla risposta current-user; l’attività è completata quando la richiesta non produce più l’errore segnalato "Not found".

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.