support enums whose unit variants serialize as something other than strings
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reading how typespace represents enums and generates serialization code; the issue does not name specific files or tests. Trace how enum variants are represented and how generated code handles serde serialization and deserialization, then check the related Display and FromStr behavior. Done means typespace can represent variants serialized as arbitrary JSON values and generate the corresponding implementations.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A schema like
{ "enum": [true, 1, "on"] }
has no representation in typespace today: an enum's unit variants serialize under their (renamed) Rust names, which are strings.
This isn't something serde annotations can express. External tagging is the only serde scheme that requires a unit variant's serialized value to be a string, and it's serde's default because it's the cheapest to deserialize; the other tagging forms don't help with a bare true or 1. So this takes two steps: typespace has to be able to represent a variant whose serialized form is an arbitrary JSON value, and then it has to generate Serialize and Deserialize impls for it.
Rather than treating these enums as special, my inclination is to generate the serde impls for all enums (or maybe all types). The argument for deriving is weaker than it looks: serde annotations don't appear in the docs, so the "familiar notation" benefit only reaches someone reading the generated source, and we already spend about as much effort organizing our structures to emit the right annotations as we would generating the impls directly.
Related: Display and FromStr for such an enum are the same gap seen from the other side, and should close with this.
- Lenguaje dominante
- Rust
- Estrellas
- 4
- Forks
- 4
- Merge medio
- 15 h 16 min
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de oxidecomputer/typespace
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 57/100
oxidecomputer/typespace#68 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
oxidecomputer/typespace#47 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
add a setting to annotate generated types with its idQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 1/100
oxidecomputer/typespace#45 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 36/100
oxidecomputer/typespace#44 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
oxidecomputer/typespace#41 ·
Los mantenedores suelen responder en 1 día
Todos los issues de oxidecomputer/typespace
Issues similares
-
area: cli good first issue type: feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
renaming a provider to a taken name fails with a raw sql errorPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea:storage kind:bug priority:p3 ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug bugfix
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
storytold/photocraft#16975 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
expo/exact#1716 · 1 comentario ·
Los mantenedores suelen responder en 1 día