How to replace the value list of an array?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Documentación
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- yaml
- Área
- documentation
Línea de trabajo
Comienza con la sección Action Object de la Overlay Specification y compara su redacción sobre la combinación con los ejemplos proporcionados de OpenAPI y Overlay YAML. Confirma si actualizar x-bar debe reemplazar o añadir elementos al array, y documenta el comportamiento previsto o la solución alternativa de remove-and-readd en la Specification.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I want to replace the value list of an array with a new list of values. However, the two overlay implementations I've tried treat the following example as "append to an array" rather than "replace an array".
I'm not sure if the implementation behavior is correct or a bug, so wanted to confirm the intended behavior with the spec authors.
OpenAPI document:
openapi: 1.0.0
info:
title: Array replacement test
version: 1.0.0
paths: {}
x-foo:
x-bar: # I want to replace all values of this array
- 1
- 2
Overlay:
overlay: 1.0.0
info:
title: Array replacement test
version: 0.0.1
extends: array-test.yaml
actions:
- target: $['x-foo']
update:
x-bar:
- 3
- 4
The Action Object section says:
When the Overlay document is applied, the properties in the merge object replace properties in the target object with the same name
I understand this as x-foo being the "merge object", x-bar being a "property in the merge object", so the x-bar value from the overlay should replace (and not be appended to) the x-bar value in the document.
The workaround is to remove the array node then re-add it with the new values. This seems a bit verbose, but if that's the intended way to replace arrays then I'm OK with it.
actions:
- target: $['x-foo']['x-bar']
remove: true
- target: $['x-foo']
update:
x-bar:
- 3
- 4
- Lenguaje dominante
- JavaScript
- Estrellas
- 123
- Forks
- 38
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 11
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 OAI/Overlay-Specification
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
OAI/Overlay-Specification#415 ·
Los mantenedores suelen responder en 1 día
-
update contributing guidelines to document the dev branchPosiblemente ocupada @baywet la tomó hace 6 días. Abierto
OAI/Overlay-Specification#418 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Revisit: should Overlays declare their target document format? (follow-up to #268)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
OAI/Overlay-Specification#367 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
OAI/Overlay-Specification#358 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
OAI/Overlay-Specification#299 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de OAI/Overlay-Specification
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
fossasia/scrum_helper#949 ·
Los mantenedores suelen responder en 2 días
-
Learn Faust tutorial: Blocks step says Faust loads block CSS, but no WordPress styles are appliedAbierto[Type] Bug Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
TheOdinProject/curriculum#31493 ·
Los mantenedores suelen responder en 1 día
-
[Report] Some official plugins are marked as Stable, but their Readme says they are experimentalAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
TiddlyWiki/TiddlyWiki5#10061 ·
Los mantenedores suelen responder en 1 día
-
documentation ready
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día