ResolveFully fails on internal references when the initial spec is read from a file URL
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện resolveFully với một đặc tả OpenAPI ban đầu được tải từ URL file:// và một $ref nội bộ như #/components/pathItems/getPet. Đọc Visitor.readFile() và phần xử lý URI liên quan được thể hiện trong stack trace. Thêm một bài kiểm thử hồi quy và xác nhận rằng các tham chiếu nội bộ được phân giải mà không có FileNotFoundException.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
While testing the new 3.1.0 feature of a pathItem in components, I found that resolveFully is not replacing internal references such as $ref: "#/components/pathItems/getPet" when the initial URL to the spec is a file:// URL. There is an exception in the log like this:
java.io.FileNotFoundException: file:/...../target/test-classes/petstore-3.1.yaml (Aucun fichier ou dossier de ce type)
at java.io.FileInputStream.open0(Native Method) ~[?:?]
at java.io.FileInputStream.open(FileInputStream.java:216) ~[?:?]
at java.io.FileInputStream.<init>(FileInputStream.java:157) ~[?:?]
at java.io.FileInputStream.<init>(FileInputStream.java:111) ~[?:?]
at io.swagger.v3.parser.reference.Visitor.readFile(Visitor.java:66) ~[swagger-parser-v3-2.1.13.jar:2.1.13]
at io.swagger.v3.parser.reference.Visitor.readURI(Visitor.java:84) ~[swagger-parser-v3-2.1.13.jar:2.1.13]
at io.swagger.v3.parser.reference.ReferenceVisitor.parse(ReferenceVisitor.java:279) ~[swagger-parser-v3-2.1.13.jar:2.1.13]
This is true for any internal reference from the initial specification.
The Visitor.readFile() method needs to transform the file URL to a valid path.
I've never contributed to swagger before but I could create a test case and PR for this issue.
- Ngôn ngữ chính
- Java
- Star
- 870
- Fork
- 566
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 swagger-api/swagger-parser
-
InlineModelResolver.uniqueName throws StringIndexOutOfBoundsException for titles starting with a separator (camelCaseFlattenNaming)Có thể đã có người làm @arimu1 đã nhận 58 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
swagger-api/swagger-parser#2386 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
swagger-api/swagger-parser#2168 ·
-
Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
swagger-api/swagger-parser#2408 ·
-
[Bug]: Discriminator mapping of a oneOf nested in array items gets a null key and is no longer updated after external ref resolution (regression since 2.1.36)Có thể đã có người làm @wyhasany đã nhận 12 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
swagger-api/swagger-parser#2406 · 1 bình luận ·
-
[Question]: Guidance on jackson-coreutils vulnerabilities in legacy Swagger compatibility dependencyĐang mởQuestion
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
swagger-api/swagger-parser#2405 ·
Tất cả issue của swagger-api/swagger-parser
Issue tương tự
-
staticAssetsPath follows symlinks outside the directory on WindowsCó thể đã có người làm @ybelMekk đã nhận hôm nay. Đang mởbug security findings
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
navikt/mock-oauth2-server#1132 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:working follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Sanne/incus-spawn#1683 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
checkstyle/checkstyle#22210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
google/error-prone#6239 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Failing Test]: BigqueryClient.queryUnflattened fails BigQuery ITs on a transient 503Có thể đã có người làm @mxtymoshyk đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày