Circular references in external documents create an infinite recursion
まだ誰も着手していません。
評価
調査の方向性
提供された Kiota Docker コマンドを使用して、リンクされた pet.json ファイルと pets2.json ファイルで再帰を再現し、その後、参照解決中に外部ドキュメントがワークスペースに読み込まれる方法を追跡します。添付された circular_ref.patch と現在の動作を比較します。相互に参照する外部ドキュメントが無限再帰なしに解決され、意図したワークスペースに残ることが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- 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
-
Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
難易度 2/5 1〜2日 初心者へのやさしさ 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
getsentry/sentry-dotnet#5617 · コメント 1 件 ·
-
: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 件 ·