bufbuild/es: enable json_types=true in generated SDKs

Abierto
#2,890 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #2891 de @saefty — cerrado sin fusionar

Evaluación

Dificultad
1/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript

Línea de trabajo

Find the bufbuild/es plugin configuration that sets registry.opts for generated npm SDKs and read the surrounding versioning conventions. Add json_types=true as proposed, then verify the next generated SDK's .d.ts files include JSON message types while .js output stays unchanged. Pull request #2891 is already open for this issue.

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

Descripción

The generated npm SDKs of buf.build/bufbuild/es are built with registry.opts: [import_extension=js]. protoc-gen-es v2 also has the option json_types=true, which adds a type for the JSON form of every message. Users of the generated SDKs cannot set plugin options, so they never get these types.

Use case: HTTP APIs that use the protobuf JSON mapping instead of gRPC. A client that only needs types for the JSON it receives has to derive them itself or run buf generate.

Effect: The .js output does not change. The .d.ts files gain the JSON types. toJson() without options returns the message's JSON type instead of JsonValue, so code that annotates the result as JsonValue may no longer compile.

Proposed change: add json_types=true to registry.opts of the next bufbuild/es version.

Lenguaje dominante
Dockerfile
Estrellas
75
Forks
27
Merge medio
5 h 35 min
PR fusionados (30 d)
52

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 bufbuild/plugins

Todos los issues de bufbuild/plugins

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.