-
Notifications
You must be signed in to change notification settings - Fork 349
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
Filtering out elements where value is null in Transformer #458
Comments
It'll have to be done manually, this is not really in the scope of Fractal. If a value is meant to be in the response but there is no value for it, the property should still be there but not have a value in my opinion, otherwise you're putting responsibility on your consumer to check if the keys are there in the response, which shouldn't happen. Imagine every property on the object needing the API consumer to check if it exists? |
i totally agree with @willishq .. it is better to have a "stable interface / structure" for the return types of a transformer.. however, if you want to filter out some properties that are explicitly set to I think, this issue can be closed @kickthemooon |
I think both ways are valid. Also maybe having a way to say that something does not exist (as opposed to being empty) might be a solution.
To return
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 4 weeks if no further activity occurs. Thank you for your contributions. |
Example:
This element is not filtered out. Is there some way to tell Fractal to filter out null elements or does it have to be done manually?
The text was updated successfully, but these errors were encountered: