Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Genrator seem does'nt work with custom API endpoints

Đang mở
#282 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php, typescript
Lĩnh vực
api, tooling

Hướng nghiên cứu

Tái hiện lỗi bằng lệnh @api-platform/client-generator được cung cấp đối với endpoint Swagger/Hydra và kiểm tra URL docs.jsonld#Entrypoint/ads được đề cập trong lỗi. Theo dõi cách trình tạo TypeScript phân giải các endpoint API tùy chỉnh không có các thao tác GET item; công việc được hoàn thành khi quá trình tạo kết thúc và tạo ra các interface mong đợi cho endpoint tùy chỉnh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi

We want to generate TS interfaces from swagger.
15% of our API is made up of custom API endpoints who represent other ressources this isen't no related to entities.

Ts generator seem to be blocked on the first custom API endpoint.

Custom API endpoints are defined like this :

namespace App\SwaggerEndpoint;

use ApiPlatform\Core\Annotation\ApiResource;

/**
 * @ApiResource(
 *     collectionOperations={
 *         "get": {
 *             "route_name": "app_v2_ads_getadbyid",
 *             "method": "GET",
 *             "openapi_context": {
 *                 "summary": "Get ads webview",
 *             },
 *         },
 *     },
 *     itemOperations={}
 * )
 */
class Ads
{
}

Capture d’écran du 2021-03-29 18-39-25

We execute that command :
NODE_TLS_REJECT_UNAUTHORIZED=0 npx @api-platform/client-generator --generator typescript https://xxxxxxxxx/ tsI/
This return :
Error: Unable to find the URL for "https://xxxxxxxxx/docs.jsonld#Entrypoint/ads", make sure your api resource has at least one GET item operation declared.

Is it possible to work around this problem ?

Best regards.

Ngôn ngữ chính
TypeScript
Star
376
Fork
132
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của api-platform/create-client

Tất cả issue của api-platform/create-client

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.