Don't let users attempt to alias/merge arrays
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with the YAML.load example and inspect how Psych handles an alias used with the << merge key when the aliased value is an array. The change is done when this invalid array merge is rejected with an error instead of producing a hash containing the literal << key.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I encountered the confusing behavior described below because I didn't realize that one couldn't merge arrays, only maps. Perhaps we should instead make the parser more strict and throw an error rather than producing the unexpected object structure?
The confusing behavior:
YAML.load("
# Bad! can't merge alias/arrays
foo: &foo
- a: 1
bar:
<<: *foo
")
=> {"foo"=>[{"a"=>1}], "bar"=>{"<<"=>[{"a"=>1}]}}
Note the appearance of the odd <<. I was expecting expected
{"foo"=>[{"a"=>1}], "bar"=>[{"a"=>1}]}
As discussed here, my error is that the problem is that &foo is an attempted alias for an array. It would have been ideal if the parser had indicated my error instead.
In case relevant:
ENV['RBENV_VERSION']
=> "2.4"
YAML.libyaml_version
=> [0, 1, 4]
(Also, not entirely sure if this request belongs here or at https://github.com/yaml/libyaml , please feel free to redirect me!)
- Lenguaje dominante
- Ruby
- Estrellas
- 597
- Forks
- 223
- Merge medio
- 6 h 8 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 ruby/psych
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
Psych.dump raises Encoding::CompatibilityError for UTF-16/UTF-32 stringsPosiblemente ocupada @Halvanhelv la tomó hace 29 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Todos los issues de ruby/psych
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ublue-os/homebrew-experimental-tap#774 ·
Los mantenedores suelen responder en 1 día
-
accessibility
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slovensko-digital/ops-portal#212 ·
Los mantenedores suelen responder en 1 día
-
Local evaluation buckets percentage splits with the server key, so results differ from FlagsmithAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Add PrestashopAbiertorequest
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
endoflife-date/endoflife.date#11303 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100