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

Problem when generating Typescript interface from a fresh dev-main APIP core

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

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

評価

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

調査の方向性

ここに示されているコマンドと https://api.calico.dev を使って @api-platform/client-generator で問題を再現し、その後デモ API と比較してください。まず、ジェネレーターが /contexts/Entrypoint のレスポンスをどのように処理しているか、特に curl が返す配列を追跡することから始めてください。報告された API で TypeScript インターフェースを生成できるか、またはツールが明確で対処可能なエラーを報告すれば完了です。

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

説明

bug TypeScript

API Platform version(s) affected: dev-main (v3)

Description
I try to generate typescript interfaces from client-generator tool it work sfind with the demo https://demo.api-platform.com/ but not with my personal instance but I can't make sense of the error message, any heap ?

node ➜ /srv/app/front $ npm run generate-types

> calico-front@0.0.1 generate-types
> NODE_TLS_REJECT_UNAUTHORIZED=0 npx @api-platform/client-generator --generator typescript https://api.calico.dev types/generated/ --resource Book
{
  api: Api { entrypoint: 'https://api.calico.dev', resources: [] },
  error: jsonld.InvalidUrl: Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.
      at ContextResolver._fetchContext (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:186:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async ContextResolver._resolveRemoteContext (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:117:34)
      at async ContextResolver.resolve (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:50:22)
      at async api.process (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/context.js:65:20)
      at async api.expand (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/expand.js:211:17)
      at async Function.jsonld.expand (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/jsonld.js:331:18)
      at async Promise.all (index 1) {
    details: {
      code: 'invalid remote context',
      url: 'https://api.calico.dev/contexts/Entrypoint'
    }
  },
  response: undefined,
  status: undefined
}
node ➜ /srv/app/front $ curl https://api.calico.dev/contexts/Entrypoint
[{"@vocab":"https:\/\/api.calico.dev\/docs.jsonld#","hydra":"http:\/\/www.w3.org\/ns\/hydra\/core#","book":{"@id":"Entrypoint\/book","@type":"@id"}}]
主要言語
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 を短くまとめたダイジェスト。