-
-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
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
[FEAT] Add value transformer to de/serializer #572
Comments
Good Idea :). const SALT = 'SALT';
class Entity {
@PropertySerialize(v => hashids.encode(SALT, v))
@PropertyDeserialize(e => hashids.decode(SALT, e))
@PrimaryColumn()
id: number;
} What do you think ? |
Great. Maybe better also add it to JsonPropertyOptions? I just made an example Also, I noticed the #539 but it's seems stalled. Split ser/des to a standalone package is a great idea, the existing converter system is a bit tricky. It would be nice to redesign the API of the converter system to keep it clean and elegant. |
@edgesite I don't understand in your code why you change the IConverterOptions with decode and encode, because decode/encode are applied on a specific prop. Yes #539 is a test. Problem: It's a breaking change for developers, because it require to add this dependency in package.json for each projects using Ts.ED (like @tsed/di and @tsed/common). Right know, I'll work on your feature ;). Refactoring jsonschema/converter will be done in another PR in future. See you |
@Romakita oh I just miss Also, can we document *Registry to show users how to create custom filters? It's really a pain feature and needs looking into the code right now. |
Information
Description
Add value transformer to des/serializer can help apply Hashids like mechanism much easier.
Example
The text was updated successfully, but these errors were encountered: