Support xs-ms-enum values without the "value" label
まだ誰も着手していません。
評価
調査の方向性
まず XmsEnumExtension と XmsEnumValue を調べ、次に OpenApi-Diff の比較パスで、示されている x-ms-enum JSON を使って Newtonsoft.Json のデシリアライズ失敗を再現します。3、4、5 を含む、プリミティブ値として表現された enum エントリが、JsonSerializationException をスローせずにデシリアライズおよび比較できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Some contract generators define the values of x-ms-enum as a list of actual values without labels.
The current version OpenApi-Diff doesn't support this format and throws a Newtonsoft.Json.JsonSerializationException in this case.
Example of x-ms-enum with and without the "value" label
"enum": [
"Mammals",
"Fish",
"Birds",
"Reptiles",
"Amphibians",
"Invertebrates"
],
"type": "string",
"x-ms-enum": {
"name": "PetType",
"modelAsString": false,
"values": [
{
"value": 0,
"description": "humans and all other animals that are warm-blooded vertebrates",
"name": "Mammals"
},
{
"value": 1,
"description": "aquatic, craniate, gill-bearing animals that lack limbs with digits"
},
{
"value": 2,
"name": "Birds"
},
3,
4,
5
],
"x-nullable": false
}
The issue with this XmsEnumExtension is that we cannot cast an object of primitive type (e.g. long, string) to a XmsEnumValue , thus all contracts that contains x-ms-enum with a list of values of primitive type causes a deserialization issue in the OpenApiDiff comparison.
The exception is the following
Newtonsoft.Json.JsonSerializationException : Error converting value 3 to type 'AutoRest.Swagger.Model.XmsEnumValue'. Path 'definitions.PetType.x-ms-enum.values[0]', line 235, position 11.
----> System.ArgumentException : Could not cast or convert from System.Int64 to AutoRest.Swagger.Model.XmsEnumValue.
- 主要言語
- C#
- スター
- 290
- フォーク
- 50
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/openapi-diff のほかの issue
-
Azure/openapi-diff#482 · 担当者 1 名 ·
-
Azure/openapi-diff#479 · コメント 2 件 · 担当者 1 名 ·
-
Azure/openapi-diff#456 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Azure/openapi-diff#445 ·
-
Azure/openapi-diff#371 · コメント 7 件 · 担当者 1 名 ·
Azure/openapi-diff の issue をすべて見る
似ている issue
-
:watch: Not Triaged dotnet-fsharp/svc
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Azure/azure-sdk-for-net#63292 · コメント 3 件 · リアクション 1 件 ·
-
Issue-Enhancement Needs-Triage
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
PowerShell/PowerShell#28061 · リアクション 2 件 ·
-
dependencies needs-team-triage server-Azure.Mcp
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
dotnet/AspNetCore.Docs#37729 ·