How to replace the value list of an array?
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- yaml
- Ambito
- documentation
Direzione di ricerca
Inizia con la sezione Action Object della Overlay Specification e confronta la relativa formulazione sull’unione con gli esempi OpenAPI e Overlay YAML forniti. Conferma se l’aggiornamento di x-bar debba sostituire o aggiungere elementi all’array e documenta il comportamento previsto oppure la soluzione alternativa remove-and-readd nella Specification.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 122
- Fork
- 38
- Merge medio
- 1g 17h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OAI/Overlay-Specification
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
OAI/Overlay-Specification#415 ·
I maintainer di solito rispondono entro 1 giorno
-
ci: update the agenda template to lead us down the path of checking the spec repoForse già presa @baywet l’ha presa 9 giorni fa. Aperta
OAI/Overlay-Specification#411 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
ci: add automation to sync from main -> dev -> vX.Y-dev branchesForse già presa @baywet l’ha presa 9 giorni fa. Aperta
OAI/Overlay-Specification#410 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Revisit: should Overlays declare their target document format? (follow-up to #268)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
OAI/Overlay-Specification#367 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
OAI/Overlay-Specification#358 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OAI/Overlay-Specification
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
saayam-for-all/webapp#1919 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Uuriko/project-room#3728 ·
I maintainer di solito rispondono entro 1 giorno
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
vercel/ai#23435 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
docs(site): Mermaid edge-label contrast on Architecture and a table header on How it comparesApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
devops-thiago/ThrillhouseBot#1132 ·
I maintainer di solito rispondono entro 1 giorno