types_from_serializers
types_from_serializers copied to clipboard
Cannot use name_from_serializer
- [X] I have tried upgrading by running
bundle update types_from_serializers
. - [X] I have read the troubleshooting section before opening an issue.
Description 📖
When using:
if Rails.env.development?
TypesFromSerializers.config do |config|
config.name_from_serializer = ->(name) { name }
end
end
and then issuing the command:
bundle exec rake types_from_serializers:generate
no serializers are found
bundle exec rake types_from_serializers:generate
Generating TypeScript interfaces...completed in 0.0 seconds.
Found 0 serializers:
while, when removing the line config.name_from_serializer = ->(name) { name }
, everything works as it should.
I only wanted to make sure the generated types got a prefix, which should not interfere with the finding of serializers.
Hi Rein, thanks for reporting.
Can you replicate it in the examples in this repo or provide a minimal reproduction?
I could not replicate this, using config.name_from_serializer = ->(name) { name }
will generate interfaces, with a different name and in different dirs as expected.
Feel free to reopen if you provide a reproduction.