Skip to content
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

[Question] Accessing Manager from inside Transformer #72

Closed
dimassrio opened this issue Mar 18, 2020 · 4 comments
Closed

[Question] Accessing Manager from inside Transformer #72

dimassrio opened this issue Mar 18, 2020 · 4 comments

Comments

@dimassrio
Copy link

Hi, just curious if there is a way to change serializer from inside the transformer.

Sometime when returning X-to-one relation it's better to change from DataSerializer into PlainSerializer (Resource.item()) since it will have another nesting variable inside the relations.

Already read the code, but can't find out myself. Thanks for the help.

@rhwilr
Copy link
Owner

rhwilr commented Mar 18, 2020

This is currently not supported.

It might be something we can solve with a custom serializer. But we would have to provide the serializer with information about the nesting level. I'll take a look at this.

@rhwilr
Copy link
Owner

rhwilr commented Mar 18, 2020

I tried a few things and came up with the sld (single-level-data) serializer.
It is currently in a feature branch. Would you mind checking it out and letting me know if this fits your usecase?

npm install --save rhwilr/adonis-bumblebee#single-level-data-serializer

You'll have to set the serializer to sld in the config.

@Kinvaras
Copy link

Hi @rhwilr , this is exactly what I was looking for.

@rhwilr
Copy link
Owner

rhwilr commented Apr 13, 2020

Thanks for the feedback. This feature has now been released in version 2.2.0.

@dimassrio If this didn't address your issue, please let me know.

@rhwilr rhwilr closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants