Enum types are not being generated by the Typescript Generator
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- php, typescript
- 領域
- tooling
調査の方向性
ドキュメントに記載されている npm init @api-platform/client コマンドを、TypeScript ジェネレーターと、示されている Gender enum を持つ Person のようなエンティティで実行するところから始めます。生成された Person interface を調べ、gender プロパティがどのように any になるかを追跡します。生成された出力が enum の値を表し、interface で any の代わりにその enum を使用していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
API Platform version(s) affected: 3.0
Description
I'm using the Typescript Generator to generate some interfaces and I have some enum types in the Entity, for example:
<?php
//Enum
namespace App\Enum;
enum Gender: string
{
case FEMALE = 'female';
case MALE = 'male';
}
<?php
// Entity
class Person
{
...
#[ORM\Column(type: "string", length: 6, nullable: true, enumType: Gender::class)]
private $gender;
...
but when I generate the interfaces, they are generated as type any.
How to reproduce
Create an entity with an enum type. Use the Typescript generator to generate the corresponding interface:
npm init @api-platform/client http://localhost/api src/ -- --generator typescript
The interface generated will be of type any instead of having the proper enum type:
export interface Person {
...
gender?: any;
...
}
Possible Solution
The generator should generate the corresponding enum and implement it in the interface:
export interface Person {
...
gender?: gender;
...
}
export enum gender {
FEMALE = 'female',
MALE = 'male',
}
Additional Context
- 主要言語
- TypeScript
- スター
- 376
- フォーク
- 132
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
api-platform/create-client のほかの issue
-
[potential Security Alert] New `test-vue-app` script added in `@api-platform/[email protected]`オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
api-platform/create-client#396 ·
-
[potential Security Alert] New `test-nuxt-app` script added in `@api-platform/[email protected]`オープン
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
api-platform/create-client#397 ·
-
[potential Security Alert] New `test-next-app` script added in `@api-platform/[email protected]`オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
api-platform/create-client#395 ·
-
[potential Security Alert] New `test-react-app` script added in `@api-platform/[email protected]`オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
api-platform/create-client#394 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
api-platform/create-client#393 · コメント 1 件 ·
api-platform/create-client の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
homarr-labs/dashboard-icons#2939 ·
メンテナーはふだん 1 日以内に返信
-
Agent/category reasoning variants are still checked against the stale model cache in chat.paramsオープンopencode
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
code-yeongyu/oh-my-openagent#10003 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
Actions on Toastsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
メンテナーはふだん 1 日以内に返信