We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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:
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:
The interface generated will be of type
any
instead of having the proper enum type:Possible Solution
The generator should generate the corresponding enum and implement it in the interface:
Additional Context
The text was updated successfully, but these errors were encountered: