OpenApiVisitorBase PathString is not correct for v2 documents
@baywet がすでに取り組んでいます。
2026年4月16日 から。
評価
この issue はまだ評価されていません。
説明
Describe the bug
The OpenApiVisitorBase.PathString is documented as 'Pointer to source of validation error in document', but when used with OpenApiWalker and the built-in validation system, it does not produce correct pointers when the input document is in the v2 format. This is because the walker operates on the shared data model which mirrors the v3 structure - which has already been manipulated by the v2 reader.
OpenApi File To Reproduce
{
"swagger": "2.0",
"info": {
"title": "Test API",
"version": "1.0.0"
},
"paths": {
"/items": {
"get": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": null
}
}
}
}
}
}
}
}
Expected behavior
I'd expect a validation error with the pointer:
#/paths/~1items/get/responses/200/schema/properties/name
Instead, we see a validation error with the pointer:
#/paths/~1items/get/responses/200/content/application~1octet-stream/schema/name
This example actually has two separate bugs in one:
- It looks like a v3 pointer - the 'content/application~1octet-stream' is not present in the document.
- It is also missing 'properties' path segment due to a bug in the
ValidateSchemaPropertyHasValuerule.
Additional context
Ideally it seems like we need the walker to 'undo' the changes that the v2 reader makes to the structure so it can track what the pointer in the underlying document actually is.
At minimum we should document that the PathString is a path to the internal document representation, and not the original document - but IMO it's more useful to have a path to the location in the input document.
- 主要言語
- C#
- スター
- 1.6k
- フォーク
- 286
- 平均マージ
- 6時間 38分
- マージ済み PR(30日)
- 35
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/OpenAPI.NET のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · コメント 1 件 · リアクション 1 件 · 担当者 2 名 ·
-
type:breaking-change
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/OpenAPI.NET#3014 · コメント 2 件 ·
-
help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/OpenAPI.NET#2989 · コメント 3 件 ·
-
help wanted type:feature
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
microsoft/OpenAPI.NET#2967 · コメント 18 件 · リアクション 1 件 ·
microsoft/OpenAPI.NET の 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 ·