microsoft / microsoft/OpenAPI.NET.OData

Set request body to optional when all properties are optional

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

関連するプルリクエストがすでにマージされています。

  • #775 @baywet による — マージ済み
priority:p1
主要言語
C#
スター
240
フォーク
70
平均マージ
7時間 59分
マージ済み PR(30日)
13

説明

Related to https://github.com/microsoftgraph/msgraph-sdk-java/pull/2163 and https://github.com/microsoftgraph/msgraph-sdk-dotnet/pull/2671#discussion_r1765012196

In a scenario where all the properties in the request body are optional such as an odata action with all parameters being optional, we should set the requestBody.required = false in the generated openApi description otherwise explictly set it to true.

https://spec.openapis.org/oas/v3.0.3.html#fixed-fields-10

This will unlock the generation of request body parameters in the SDKs as optional parameters in the builders to prevent breaking changes in scenarios where optional parametes are added.

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

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

はじめの一歩

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

調査の方向性

まず、リンクされた Microsoft Graph の pull request と、OpenAPI 3.0.3 の request-body 固定フィールド仕様を確認します。生成された OpenAPI 記述のどこで requestBody.required が決定されるかを追跡します。完了の条件は、すべてのプロパティが optional な body について optionality が正しく表現され、required な body が引き続き明示的に required として扱われることです。

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

評価

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

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

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