Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Easier way to replace an array?

オープン
#60 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
52/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
powershell
領域
documentation

調査の方向性

リンクされた wiki ページの「Default Transformation」セクションと「Replace Transformation」セクションから始め、issue にある 2 つの appsettings.json の例に照らして、文書化されている array の動作を検証してください。より短いサポート対象の構文が存在する場合はそれを文書化し、存在しない場合は既存の @jdt.replace 形式とその期待される出力を明確にしてください。

索引モデルが issue の本文から書いたものです。

説明

Under the "Default Transformation" section there is an array listed as "SupportedVersions" that says the default transformation for arrays is append but when going to the "Replace" section, it does not show how to replace an array.

Let's assume I have 2 appsettings.json files that need merged so that the SupportedVersions array is replaced when listed under the Settings section.

First file

{
    "Settings": {
        "SupportedVersions" : [1, 2]
    }
}

Second file

{
    "Settings": {
        "SupportedVersions" : [3, 4]
    }
}

Expected output

{
    "Settings": {
        "SupportedVersions" : [3, 4]
    }
}

I can get this to work by using the following but is there an easier way that I can't find in the documentation?
This works but is long

{
    "Settings": {
        "@jdt.replace" : {
            "@jdt.path" : "$.SupportedVersions",
            "@jdt.value" : [3, 4]
        }
    }
}
主要言語
PowerShell
スター
117
フォーク
38
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/json-document-transforms のほかの issue

microsoft/json-document-transforms の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。