microsoft / microsoft/OpenAPI.NET.OData

POST actions to insert new entity has empty parameters

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

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

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

説明

I'm using version 2.0.0-preview.15 and when I generate the OpenAPI document from my OData metadata file all the POST actions to insert a new entity have no parameters (thus no schema).

I've tried manually adding InsertRestrictions vocabulary and setting the value to true and that didn't seem to help. I tried this on the EntitySet and on the Entity itself

Here is an example of my metadata

<EntitySet Name="Products" EntityType="Product">
<Annotation Term="Org.OData.Capabilities.V1.InsertRestrictions">
<Record>
<PropertyValue Property="NonInsertableProperties">
<Collection>
<String>ID</String>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</EntitySet>

Then the resulting OpenAPI schema generated

"post": {
        "tags": [
          "Products.Product"
        ],
        "summary": "Add new entity to Products",
        "operationId": "Products.Product.CreateProduct",
        "requestBody": {
          "description": "New entity",
          "content": {
            "application/json": { }
          },
          "required": true
        },

Am I missing something in the OpenApiConvertSettings? Is this a known issue? Thank you

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

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

はじめの一歩

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

調査の方向性

ソースファイル、テスト、エントリポイントのいずれも指定されていません。提供された OData メタデータとバージョンを使って問題を再現し、その後 OpenApiConvertSettings と生成された POST リクエスト本文を調査します。生成された application/json コンテンツに、NonInsertableProperties を尊重した期待されるエンティティスキーマが含まれていれば完了です。

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

評価

技術スタック
csharp, openapi
領域
api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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