api-platform / api-platform/create-client
Genrator seem does'nt work with custom API endpoints
- Langage dominant
- TypeScript
- Étoiles
- 376
- Forks
- 132
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
{
}
```

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.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.