Every property marked as optional + 'any' types
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ệ
- openapi, typescript
Hướng nghiên cứu
Bắt đầu từ TypeScript interface generator và lần theo cách tính bắt buộc của các thuộc tính Swagger/OpenAPI cũng như các kiểu nguyên thủy được ánh xạ như thế nào. So sánh ví dụ ContactPerson với schema của nó, sau đó xác minh rằng các thuộc tính bắt buộc không phải là tùy chọn và các thuộc tính string hoặc date được ghi trong tài liệu không trở thành any.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
API Platform version(s) affected: 3.0
Description
I generated typescript interfaces from a API Platform with this package. This worked really well, but there are two issues that make the result pretty much unusable for me:
- Every property is marked as optional, even '@id'. Having to manual check for every property kinda defeats the purpose of having the interfaces in the first place.
- Some properties are marked as
any, even though there is a proper type in the API docs. E.g.ContactPerson.imageis listed asstringin Swagger, but appears asanyin TypeScript. I also noticed dates beingany– but this was in a API Platform 2.6 project and might not be an issue in newer versions.
Here is an example taken out of my Swagger docs:
{
"hydra:member": [
{
"@context": "string",
"@id": "string",
"@type": "string",
"id": "string",
"name": "string",
"phoneNumber": "string",
"email": "string",
"jobAdvertisements": [
"string"
],
"image": "string"
}
],
"hydra:totalItems": 0,
"hydra:view": {
"@id": "string",
"type": "string",
"hydra:first": "string",
"hydra:last": "string",
"hydra:previous": "string",
"hydra:next": "string"
},
"hydra:search": {
"@type": "string",
"hydra:template": "string",
"hydra:variableRepresentation": "string",
"hydra:mapping": [
{
"@type": "string",
"variable": "string",
"property": "string",
"required": true
}
]
}
}
And this is the generated interface:
export interface ContactPerson {
"@id"?: string;
name?: string;
phoneNumber?: string;
email?: string;
jobAdvertisements?: string[];
image?: any;
}
- Ngôn ngữ chính
- TypeScript
- Star
- 113
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 api-platform/api-doc-parser
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
api-platform/api-doc-parser#130 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
api-platform/api-doc-parser#129 · 1 bình luận ·
-
api-platform/api-doc-parser#125 · 1 bình luận · 1 người được giao ·
-
api-platform/api-doc-parser#115 · 4 bình luận · 1 người được giao ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
api-platform/api-doc-parser#113 ·
Tất cả issue của api-platform/api-doc-parser
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100