Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Genrator seem does'nt work with custom API endpoints

オープン
#282 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php, typescript
領域
api, tooling

調査の方向性

提供された @api-platform/client-generator コマンドを Swagger/Hydra エンドポイントに対して実行して失敗を再現し、エラーで言及されている docs.jsonld#Entrypoint/ads URL を調査します。GET アイテム操作を持たないカスタム API エンドポイントを TypeScript ジェネレーターがどのように解決するかを追跡します。完了の条件は、生成が完了し、カスタムエンドポイントに対して期待されるインターフェイスが生成されることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
376
フォーク
132
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

api-platform/create-client のほかの issue

api-platform/create-client の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。