How to replace the value list of an array?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- yaml
調査の方向性
Overlay Specification の Action Object セクションから始め、マージに関するその記述を、提供されている OpenAPI および Overlay YAML の例と比較してください。x-bar の更新で配列を置き換えるべきか追加すべきかを確認し、意図された動作、または Specification における remove-and-readd の回避策を文書化してください。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 123
- フォーク
- 38
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OAI/Overlay-Specification のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
OAI/Overlay-Specification#415 ·
メンテナーはふだん 1 日以内に返信
-
update contributing guidelines to document the dev branch対応中かも @baywet が 7 日前に担当しました。 オープン
OAI/Overlay-Specification#418 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Revisit: should Overlays declare their target document format? (follow-up to #268)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
OAI/Overlay-Specification#367 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
OAI/Overlay-Specification#358 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
OAI/Overlay-Specification#299 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
OAI/Overlay-Specification の issue をすべて見る
似ている issue
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
TanbirRamim/open-source-radar#353 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 2 日以内に返信
-
design-review mac P3 ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tosunlab/hisarapp-core#502 ·
-
enhancement status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mastra-ai/mastra#28651 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement frontend help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nikhilb2/simple_invoicing#470 ·
メンテナーはふだん 1 日以内に返信