V2 - make update/remove/copy mutually exclusive

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
yaml

調査の方向性

まず、提案されているアクションオブジェクトスキーマと、update/copy/remove の組み合わせに関する添付の3つの YAML 例を確認します。v1 言語とスキーマがどこで定義されているかを追跡し、各アクションがこれらのキーワードのうち1つだけを許可すること、そして例が適切に拒否されることを検証します。

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

説明

not-remove-with-copy.yaml
not-update-with-copy.yaml
not-update-with-remove.yaml

The v1 specification allows update/copy/remove to be in the same action definition even though it's semantically meaningless. It also defines "an order of precedence" of each keyword, which is going to become more difficult to maintain, and understand by readers, as we introduce more keywords.

I propose that we make those mutually exclusive in the language, but also in the schema. Here is the salvaged schema update from my pull request.

  action-object:
    properties:
      target:
        type: string
        pattern: ^\$
      description:
        type: string
    oneOf:
      - properties:
          update:
            type:
              - string
              - boolean
              - object
              - array
              - number
              - "null"
        required:
          - update
      - properties:
          copy:
            type: string
        required:
          - copy
      - properties:
          remove:
            type: boolean
            default: false
        required:
          - remove
    required:
      - target
    $ref: "#/$defs/specification-extensions"
    unevaluatedProperties: false
  specification-extensions:
    patternProperties:
      ^x-: true

Originally posted by @baywet in https://github.com/OAI/Overlay-Specification/pull/150#discussion_r2448832872

主要言語
JavaScript
スター
126
フォーク
37
平均マージ
4日 18時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

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

OAI/Overlay-Specification のほかの issue

OAI/Overlay-Specification の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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