api-platform / api-platform/create-client

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
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

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 :
```php
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](https://user-images.githubusercontent.com/28094259/112870271-52aa2380-90be-11eb-9ac9-4768ef3790ad.png)

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.