[REQ] [typescript-*] add flag to don't convertation some types
Created by: gormonn
Hello! I partially use your wonderful tool to generate types for redux-toolkit-query. More details can be found here: https://github.com/rtk-incubator/rtk-query-codegen/issues/63#issuecomment-879219548
However, when the API changes, I have to compare the new generated files with the old ones. For example, since Redux prefers to store serializable data, I need to rewrite the generated date to string types, and then I need to rewrite some functions that convert strings to dates. From:
interface Car {
id: string;
yearOfManufacture: Date;
}
function CarFromJSON(json: any): Car {
return {
id: json['id'],
yearOfManufacture: new Date(json['year_of_manufacture']),
};
}
To:
interface Car {
id: string;
yearOfManufacture: string;
}
function CarFromJSON(json: any): Car {
return {
id: json['id'],
yearOfManufacture: json['year_of_manufacture'],
};
}
So... With each new iteration, the number of models grows, and such differences between the generated types and the actual ones remain. This makes Diff very difficult.
What I suggest: Perhaps there is a way to make the generator behavior customizable? For example for data serializability.