-
Hi there! In the process of migrating from ams to this little beauty, and wondering if there's any plans to support |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Anders! One of the reasons this library is more performant is that the code for serialization is generated at load time. Supporting I'd be open to supporting it if we find an implementation that does not negatively affect the default case. That might require using a different execution path when As a workaround when migrating from AMS or similar libraries, you can use the attribute :name, if: -> { !options[:except]&.include?(:name) } For performance (and for robustness if generating types from serializers), it's better to avoid conditional attributes, and instead use different serializers when you need different attributes. |
Beta Was this translation helpful? Give feedback.
Hi Anders!
One of the reasons this library is more performant is that the code for serialization is generated at load time.
Supporting
only
andexcept
would require dynamically iterating the list of attributes to find out which ones to render, which is slower.I'd be open to supporting it if we find an implementation that does not negatively affect the default case. That might require using a different execution path when
only
orexcept
are provided.As a workaround when migrating from AMS or similar libraries, you can use the
if
option in an attribute, for example:For performance (and for robustness if generating types fro…