Crash if duplicate model names (across files) used in allOf
@mikeharder がすでに取り組んでいます。
2026年5月5日 から。
評価
この issue はまだ評価されていません。
説明
A TSP conversion PR resulted in this error:
"details":"incompatible properties : tags
definitions/ContainerGroup/properties/tags
at file:///home/runner/work/azure-rest-api-specs/azure-rest-api-specs/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/ContainerInstance/stable/2025-09-01/containerInstance.json#L2245:8
definitions/Resource/properties/tags
at file:///home/runner/work/azure-rest-api-specs/azure-rest-api-specs/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/ContainerInstance/stable/2025-09-01/containerInstance.json#L4642:8"
- https://github.com/Azure/azure-rest-api-specs/actions/runs/23628050434
- https://github.com/Azure/azure-rest-api-specs/pull/41602
Root cause, oad cannot handle two definitions in different files with the same name, if one definition is used in an allOf:
duplicate-names.json
{
"swagger": "2.0",
"info": {
"title": "duplicate-names",
"version": "1.0"
},
"paths": {},
"definitions": {
"Bar": {
"type": "object",
"properties": {
"p1": {
"type": "string"
}
},
"allOf": [
{
"$ref": "./common-types.json#/definitions/Foo"
}
]
},
"Foo": {
"type": "object",
"properties": {
"p1": {
"type": "object"
}
}
}
}
}
common-types.json
{
"swagger": "2.0",
"info": {
"title": "common-types",
"version": "1.0"
},
"paths": {},
"definitions": {
"Foo": {
"type": "object",
"properties": {
"p1": {
"type": "string"
}
}
}
}
}
test result
incompatible properties : p1
definitions/Bar/properties/p1
at file:///home/mharder/openapi-diff-mh/incompat-prop/src/test/specs/incompatible-properties/duplicate-names.json#L12:8
definitions/Foo/properties/p1
at file:///home/mharder/openapi-diff-mh/incompat-prop/src/test/specs/incompatible-properties/duplicate-names.json#L25:8
Reason, it assumes model names are unique across all files:
Related: #347
- 主要言語
- C#
- スター
- 290
- フォーク
- 50
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/openapi-diff のほかの issue
-
Azure/openapi-diff#482 · 担当者 1 名 ·
-
Azure/openapi-diff#456 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Azure/openapi-diff#445 ·
-
Azure/openapi-diff#371 · コメント 7 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Azure/openapi-diff#364 · コメント 4 件 ·
Azure/openapi-diff の issue をすべて見る
似ている issue
-
Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
難易度 2/5 1〜2日 初心者へのやさしさ 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
getsentry/sentry-dotnet#5617 · コメント 1 件 ·
-
: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 件 ·