Circular references in external documents create an infinite recursion
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Riproduci la ricorsione con i file collegati pet.json e pets2.json usando il comando Docker di Kiota fornito, quindi traccia il modo in cui i documenti esterni vengono caricati nei workspace durante la risoluzione dei riferimenti. Confronta il circular_ref.patch allegato con il comportamento attuale; il lavoro è considerato completato quando i documenti esterni che si referenziano reciprocamente vengono risolti senza ricorsione infinita, rimanendo nel workspace previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- 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
-
Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficoltà 2/5 1-2 giorni Idoneità per principianti 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
getsentry/sentry-dotnet#5617 · 1 commento ·
-
: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 ·