Circular references in external documents create an infinite recursion
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Reproduisez la récursion avec les fichiers liés pet.json et pets2.json à l’aide de la commande Docker Kiota fournie, puis suivez la manière dont les documents externes sont chargés dans les espaces de travail lors de la résolution des références. Comparez le circular_ref.patch joint avec le comportement actuel ; le travail est considéré comme terminé lorsque des documents externes se référant mutuellement sont résolus sans récursion infinie tout en restant dans l’espace de travail prévu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
Open api documents that contain circular references create an infinite recursion because each external document is loaded into a new root workspace rather than the initial document loader workspace.
OpenApi File To Reproduce
In order to reproduce, you need two files that reference each other. I've put a circular reference in the schemas section of the below specs (this is not the exact problem I'm seeing with real documents, but it's close enough to reproduce). The references are hard coded to a mount directory because I'm using kiota as a driver, so you may need to update the paths if you run against a different location.
Expected behavior
I believe external documents should all be loaded into the same workspace for reference resolution.
Screenshots/Code Snippets
docker run --rm `
-v "${PWD}\output:/app/output" `
-v "${PWD}\specs:/app/specs" `
-u root `
mcr.microsoft.com/openapi/kiota generate --language csharp -n MyCode --openapi ./specs/pet.json --log-level trace
I have encountered the problem in open api documents from large enterprise software providers, so I've attached a patch file that contains my work around for an internal fork of the document loader libraries. Adding external documents to the root workspace created by the initial document load appears to resolve the problem, though I'm not sure if the external references are being resolved correctly.
This patch includes the changes I was required to make in order to resolve locally.
circular_ref.patch
- Langage dominant
- C#
- Étoiles
- 1.6k
- Forks
- 286
- Merge moyen
- 6 h 38 min
- PR mergées (30 j)
- 35
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/OpenAPI.NET
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 commentaire · 1 réaction · 2 personnes assignées ·
-
type:breaking-change
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
microsoft/OpenAPI.NET#3014 · 2 commentaires ·
-
Implement equality (`IEquatable<T>` and override object.Equals/GetHashCode) for object models Ouvertehelp wanted
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
microsoft/OpenAPI.NET#2989 · 3 commentaires ·
-
help wanted type:feature
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
microsoft/OpenAPI.NET#2967 · 18 commentaires · 1 réaction ·
Toutes les issues de microsoft/OpenAPI.NET
Issues similaires
-
Add more to the documentation Ouverte:watch: Not Triaged dotnet-fsharp/svc
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Azure/azure-sdk-for-net#63292 · 3 commentaires · 1 réaction ·
-
Issue-Enhancement Needs-Triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
PowerShell/PowerShell#28061 · 2 réactions ·
-
dependencies needs-team-triage server-Azure.Mcp
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
dotnet/AspNetCore.Docs#37729 ·