OpenApiVisitorBase PathString is not correct for v2 documents
@baywet ci sta già lavorando.
Dal 16/4/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 1.6k
- Fork
- 286
- Merge medio
- 6h 38m
- PR unite (30g)
- 35
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/OpenAPI.NET
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 commento · 1 reazione · 2 assegnatari ·
-
type:breaking-change
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
microsoft/OpenAPI.NET#3014 · 2 commenti ·
-
Implement equality (`IEquatable<T>` and override object.Equals/GetHashCode) for object models Apertahelp wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoft/OpenAPI.NET#2989 · 3 commenti ·
-
help wanted type:feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
microsoft/OpenAPI.NET#2967 · 18 commenti · 1 reazione ·
Tutte le issue di microsoft/OpenAPI.NET
Issue simili
-
:watch: Not Triaged dotnet-fsharp/svc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/azure-sdk-for-net#63292 · 3 commenti · 1 reazione ·
-
Issue-Enhancement Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
PowerShell/PowerShell#28061 · 2 reazioni ·
-
dependencies needs-team-triage server-Azure.Mcp
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dotnet/AspNetCore.Docs#37729 ·