OpenApiVisitorBase PathString is not correct for v2 documents
@baywet ya está trabajando en esto.
Desde el 16/4/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 1.6k
- Forks
- 286
- Merge medio
- 6 h 38 min
- PR fusionados (30 d)
- 35
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/OpenAPI.NET
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 comentario · 1 reacción · 2 asignados ·
-
type:breaking-change
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
microsoft/OpenAPI.NET#3014 · 2 comentarios ·
-
Implement equality (`IEquatable<T>` and override object.Equals/GetHashCode) for object models Abiertohelp wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
microsoft/OpenAPI.NET#2989 · 3 comentarios ·
-
help wanted type:feature
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
microsoft/OpenAPI.NET#2967 · 18 comentarios · 1 reacción ·
Todos los issues de microsoft/OpenAPI.NET
Issues similares
-
Add more to the documentation Abierto:watch: Not Triaged dotnet-fsharp/svc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Azure/azure-sdk-for-net#63292 · 3 comentarios · 1 reacción ·
-
Issue-Enhancement Needs-Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
PowerShell/PowerShell#28061 · 2 reacciones ·
-
dependencies needs-team-triage server-Azure.Mcp
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
dotnet/AspNetCore.Docs#37729 ·