KnpLabs / KnpLabs/php-github-api

Error when adding a label to an issue

Abierto
#1,035 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
PHP
Estrellas
2.2k
Forks
587
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello,

I have an error when I try to add a label on an issue, following [this documentation](https://github.com/KnpLabs/php-github-api/blob/master/doc/issue/labels.md#add-a-label-on-an-issue).

Here is how I do it:

```php
$labels = $client->api('issue')->labels()->add('matthieu-rolland', 'test-issuebot', 51, 'Fixed');
```

And here is what I get:

`PHP Fatal error: Uncaught Github\Exception\RuntimeException: Invalid request.
No subschema in "anyOf" matched.
`

When I debug I see that the response I get is actually:

`ERROR 422 Unprocessable Entity`

I didn't manage to identify the cause of this problem...

**Some more information:**

- It does work when I call github's API directly via postman with the same github token
- While debugging I saw that the URI and HTTP methods seem correct (but maybe not until the end?)
- I'm not sure about the request's body
- VERSION 2.12.1

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start with the add-a-label example in the linked issue-labels documentation and the PHP call shown for version 2.12.1. Compare the request body and response handling with the successful Postman request; done means adding the label no longer produces the 422 Invalid request error.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github, php
Área
api
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.