How to replace the value list of an array?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- yaml
调研方向
从 Overlay Specification 的 Action Object 部分开始,将其中关于合并的措辞与提供的 OpenAPI 和 Overlay YAML 示例进行比较。确认更新 x-bar 时应替换 array 还是追加到 array 中,并在 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
- 星标
- 122
- 派生
- 38
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OAI/Overlay-Specification 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
OAI/Overlay-Specification#415 ·
维护者通常 1 天内回复
-
ci: update the agenda template to lead us down the path of checking the spec repo可能已有人在做 @baywet 于 10 天前认领。 未关闭
OAI/Overlay-Specification#411 · 已指派 1 人 ·
维护者通常 1 天内回复
-
ci: add automation to sync from main -> dev -> vX.Y-dev branches可能已有人在做 @baywet 于 10 天前认领。 未关闭
OAI/Overlay-Specification#410 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Revisit: should Overlays declare their target document format? (follow-up to #268)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 35/100
OAI/Overlay-Specification#367 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
OAI/Overlay-Specification#358 · 2 条评论 ·
维护者通常 1 天内回复
查看 OAI/Overlay-Specification 的全部 Issue
相似的 Issue
-
change request evaluating
难度 2/5 1-3 小时 新手友好度 72/100
sindresorhus/eslint-plugin-unicorn#3907 ·
维护者通常 1 天内回复
-
Android bug feature/error-tracking react-native team/error-tracking
难度 2/5 1-3 小时 新手友好度 72/100
PostHog/posthog-js#5310 · 1 条评论 ·
维护者通常 1 天内回复
-
Add Prettier and a format-check CI job可能已有人在做 @ezekielnathaniel070-ai 今天认领。 未关闭backend frontend good first issue Stellar Wave
难度 2/5 1-3 小时 新手友好度 75/100
OlaGreat/starbound-realms#98 · 1 条评论 ·
-
app request good first issue help wanted self-hosted app
难度 2/5 1-3 小时 新手友好度 75/100
Secra-Solutions/Conector#15 ·
-
Complexity: See issue making label epic good first issue Issue Making: Level 1 P-Feature: Project Info and Page role: back end/devOps role: front end size: 0.25pt time sensitive
难度 2/5 1 小时以内 新手友好度 65/100
维护者通常 1 天内回复