Improve beneathPath to work with multiple nested arrays
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- api, documentation
Hướng nghiên cứu
Start by tracing the beneathPath() entry point with the nested roles and more payload shown in the issue, comparing beneathPath("roles[].more") with the single-array case. The change is done when the nested array can be documented with fieldWithPath("id") and generated paths no longer begin with [].
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In beneathPath(), paths with an array work now, thanks to #473 and 9e1ba8a. But I'm still having a problem with arrays when there are two levels of arrays in the payload.
Consider the payload:
{
"roles": [
{
"key": "1",
"name": "one",
"more": [
{
"id": 1
}
]
},
{
"key": "1",
"name": "one",
"more": []
}
]
}
And I document it like so:
document(snippetName,
responseFields(
// beneathPath understands that roles is an array and does the right thing
beneathPath("roles").withSubsectionId("roles"),
fieldWithPath("key").description("key"),
fieldWithPath("name").description("name"),
subsectionWithPath("more").description("array")));
This will give me the fields of roles with a description of the more property. To then document the object within the more array, I do a separate snippet:
document(snippetName,
responseFields(
// now beneathPath doesn't deal with 'roles' here like it does above
beneathPath("roles[].more").withSubsectionId("more"),
fieldWithPath("[].id").description("id")));
The issue here is that at this point, the second array, the problem is the same as #473, you get a snippet with [] in front of the field path, which is functional, but not great from a documentation standpoint, which is the whole point.
To make this work like the single array, I'd expect maybe beneathPath("roles.more") to work with fieldWithPath("id"), giving me a table with Paths like id in this case.
- Ngôn ngữ chính
- Java
- Star
- 1.2k
- Fork
- 733
- 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
- Không 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 spring-projects/spring-restdocs
-
status: waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spring-projects/spring-restdocs#1075 ·
-
Support extracting Bean Validation constraints from method parametersCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởstatus: waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
spring-projects/spring-restdocs#1026 · 2 bình luận ·
-
status: blocked status: waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spring-projects/spring-restdocs#953 · 7 bình luận ·
-
Add support for modifying a URI's path during pre-processingCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởtype: enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
status: feedback-provided status: waiting-for-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
spring-projects/spring-restdocs#937 · 4 bình luận ·
Tất cả issue của spring-projects/spring-restdocs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
A proxy that fails to start logs a RejectedExecutionException stack trace from its shutdown hookĐang mởfollow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Sanne/incus-spawn#1953 ·
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 72/100
atlassian/data-center-helm-charts#1170 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Issue: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
OpenAPITools/openapi-generator#25524 ·
Maintainer thường phản hồi trong vòng 1 ngày