Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

queues subscriptions create: schema types 'events' as string but API requires an array of strings

Abierto
#181 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Start at the queues subscriptions create command and inspect how the events request-body field is represented by cf schema and --help. Verify the API accepts an array of strings, then trace the validation or discovery path for event values. Done means the schema reports array items as strings and the CLI gives accurate guidance for the accepted bare event suffix.

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

Descripción

upstream

cf schema queues subscriptions create types the events request-body field as string, but the API requires an array of strings. The description says "List of event types", so the schema contradicts itself, and the resulting failure surfaces as a generic validation error.

Version: cf v1.0.0-beta.10

Actual

$ cf schema queues subscriptions create | jq '.requestBodyFields[] | select(.name=="events")'
{
  "name": "events",
  "type": "string",
  "required": false,
  "description": "List of event types this subscription handles"
}

type is string while description says list. Passing an array of objects fails:

$ ... --body '{"source":{"type":"artifacts.repo",...},"events":[{"type":"cf.artifacts.repo.pushed"}],...}'
┌ APIError
│ [error] Validation error: Expected string, received object at "events[0]"
│ 400 Bad Request

Passing an array of strings is accepted:

$ ... --body '{...,"events":["pushed"],...}'
{ "id": "ecc4290d1c9b49909c24f49f58bb4373", ... }

Note the --events option help already renders as [array], so the flag and the schema disagree with each other as well as with the API.

Expected

"type": "array" with an items type of string, so cf schema — documented as the way to inspect the request a command sends — describes the request accurately.

Second, separate discovery problem in the same field

The Artifacts docs specify fully-qualified event types such as cf.artifacts.repo.pushed. The API rejects those and accepts only the bare suffix:

$ ... --body '{...,"events":["cf.artifacts.repo.pushed"],...}'
┌ APIError
│ [error] Validation error: Unrecognized event types for source type at "events"
$ ... --body '{...,"events":["pushed"],...}'
{ "id": "ecc4290d1c9b49909c24f49f58bb4373", ... }

There is no hint in the error listing the event types valid for the chosen source, so the valid value is only discoverable by bisection against the API. It would help if the error enumerated the accepted values, or if cf schema/--help documented the bare form for Artifacts.

Related: --source-type has no artifacts entry, reported separately.

Lenguaje dominante
TypeScript
Estrellas
960
Forks
62
Merge medio
23 h 46 min
PR fusionados (30 d)
217

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudflare/cf

Todos los issues de cloudflare/cf

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.