microsoft / microsoft/OpenAPI.NET.OData

orderby/select/expand should be oneOf when UseStringArrayForQueryOptionsSchema is false

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

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

priority:p1 type:bug
主要言語
C#
スター
240
フォーク
70
平均マージ
7時間 59分
マージ済み PR(30日)
13

説明

Currently we describe


parameters:
  - name: $select
    in: query
    style: form
    explode: false
    schema:
      uniqueItems: true
      type: array
      items:
        type: string
        enum:
          - id
          - firstName
          - ....

It should instead be


parameters:
  - name: $select
    in: query
    style: form
    explode: false
    schema:
      uniqueItems: true
      type: array
      items:
        oneOf:
        - type: string
        - type: string
           enum:
             - id
             - firstName
             - ....

This is because for any navigation property you can write $select=navProperty($expand=subproperty) and we don't want to project all possibilities. But we don't want to restrict clients to simply the scalar/first level properties.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、UseStringArrayForQueryOptionsSchema と、$select、$orderby、$expand のスキーマ生成箇所を特定します。現在生成されている OpenAPI スキーマを issue の例と比較します。ナビゲーションプロパティの式が引き続き使用可能であり、スカラーおよび第1レベルのプロパティが要求された oneOf 構造で表現されていれば完了です。

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

評価

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

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

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