microsoft / microsoft/OpenAPI.NET.OData

Action and Operation do not expose $select and $expand over entity types

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

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

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

説明

Action and Operation do not expose $select and $expand over entity types while this is possible for /entity/propertyOfComplexType

Assemblies affected

Microsoft.OpenApi.OData 1.7.5

Steps to reproduce

Register additional function for entity set:

        var fax = builder.EntityType<XFax>();
        fax.Collection.Function(nameof("GetByNumber"))
            .ReturnsFromEntitySet<XFax>("Fax")
            .NonNullable()
            .Parameter<string>("number").NonNullable();
Expected result

GetByNumber should have both $select and $expand operations because XFax is Entity type

Actual result

No operations available

Additional detail

I see that ComplexPropertyGetOperationHandler has the following logic:

  1. Expose $top, $skip, $search, $filter $count for a collection
  2. Try to expose $select and $expand

On the contrary EdmOperationImportOperationHandler has the following logic:

  1. Expose $top, $skip, $search, $filter $count for a collection
  2. Expose $select and $expand if 1. is true

Therefore I can't get $select and $expand for Function or Operation. Is it something explicitly prohibited by OData?
How can I do this in a different way?

P.S. I think as a workaround I can make alternate key. But I don't see any examples for OData 8

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

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

はじめの一歩

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

調査の方向性

ComplexPropertyGetOperationHandler と EdmOperationImportOperationHandler から始め、次に XFax エンティティ セットに登録された追加の関数を再現します。エンティティを返す関数について生成された操作を、$select と $expand の期待される動作と比較します。報告されたケースのカバレッジを含め、handler の動作を確認して修正できれば完了です。

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

評価

技術スタック
csharp
領域
api, backend-api-design
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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