Circular references in external documents create an infinite recursion
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Tái hiện đệ quy với các tệp pet.json và pets2.json được liên kết bằng lệnh Docker Kiota được cung cấp, sau đó theo dõi cách các tài liệu bên ngoài được tải vào các workspace trong quá trình phân giải tham chiếu. So sánh circular_ref.patch đính kèm với hành vi hiện tại; công việc được coi là hoàn tất khi các tài liệu bên ngoài tham chiếu lẫn nhau được phân giải mà không xảy ra đệ quy vô hạn và vẫn nằm trong workspace dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C#
- Star
- 1.6k
- Fork
- 286
- Merge trung bình
- 6 giờ 38 phút
- Pull request đã merge (30 ngày)
- 35
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/OpenAPI.NET
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 bình luận · 1 reaction · 2 người được giao ·
-
type:breaking-change
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
microsoft/OpenAPI.NET#3014 · 2 bình luận ·
-
Implement equality (`IEquatable<T>` and override object.Equals/GetHashCode) for object models Đang mởhelp wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/OpenAPI.NET#2989 · 3 bình luận ·
-
help wanted type:feature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoft/OpenAPI.NET#2967 · 18 bình luận · 1 reaction ·
Tất cả issue của microsoft/OpenAPI.NET
Issue tương tự
-
Add more to the documentation Đang mở:watch: Not Triaged dotnet-fsharp/svc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-sdk-for-net#63292 · 3 bình luận · 1 reaction ·
-
Issue-Enhancement Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
PowerShell/PowerShell#28061 · 2 reaction ·
-
dependencies needs-team-triage server-Azure.Mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
dotnet/AspNetCore.Docs#37729 ·