-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support alba transform keys in the type generation #14
Conversation
Hey @patvice! Thanks for another great PR! I'm definitely eager to add this to the gem, but I need some time to evaluate if we want to expose some kind of public API at the plugin level for key transformation. 🤔 I'll try to play with this over the week. |
Hey @skryukov! Interesting idea. We originally found this issue when we realized that our typed values were not what our serializer was producing. However, I know other projects that do the key transforms outside of the serializer to an additional public option would make sense to me. |
Yup, another thing is to ensure we play nice with |
Good point -- I didn't have that option on when I tested my change. I'll make sure that's working. |
Just to follow up with this - I was able to do some testing, and it seems like Example of an output of what's passed to [#<struct Typelizer::Property
name="fullName",
type=:string,
optional=false,
nullable=false,
multi=false,
column_name="fullName">] |
Oops closed this by mistake |
Ok, I decided to merge it since props transformation might be too specific for each serialization gem/application, so we won't expose that at the plugin level. Thanks for your PR @patvice! I will add some tests and hopefully support for other plugins as well before the next release. |
Hey! I ran into an issue when trying to get typelizer up and running on an exciting project.
Currently, the Alba serializer plugin doesn't support
transform_keys
attribute (Alba doc link). This update uses Alba's key transform method to use the specified transform type if present for both the root key and attributes.Example:
Ruby Resource
Generated TS output