Generate snake_case typescript type with SnakeCaseMapper #539
-
The //...
#[TypeScript]
#[MapName(SnakeCaseMapper::class)]
class DiscData extends Data
{
public function __construct(
public string $name,
public ?string $discLength,
#[DataCollectionOf(SongTrackData::class)]
public DataCollection $tracks,
) {
}
} declare namespace App.Data {
export type DiscData = {
name: string;
discLength: string | null;
tracks: any;
};
} I think it should be: declare namespace App.Data {
export type DiscData = {
name: string;
disc_length: string | null;
tracks: any;
};
} I can't find any documentation on either laravel-data or laravel-typescript-transformer docs. Any help would be appreciated. Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
rubenvanassche
Aug 28, 2023
Replies: 1 comment
-
Yeah at the moment, the TS transformer for data doesn't take mapped attributes into account. You're always welcome to open a PR fixing this. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ibnu-ja
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah at the moment, the TS transformer for data doesn't take mapped attributes into account. You're always welcome to open a PR fixing this.