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

loopback-next: hide model property in response #1201

Closed
vijeta-singh opened this issue Mar 28, 2018 · 7 comments
Closed

loopback-next: hide model property in response #1201

vijeta-singh opened this issue Mar 28, 2018 · 7 comments
Labels

Comments

@vijeta-singh
Copy link

Hi,

I want to hide some property in api response and I want handle this at model level.
How I can do that?

Thanks

@virkt25
Copy link
Contributor

virkt25 commented Apr 12, 2018

Hi @vijeta-singh, I'm not entirely sure what you mean by hiding some property in api response?

But if you wanted to filter a response to exclude some properties you can try the following.

  • Create a new SEND Sequence action and register that with your application ... this new action can filter the properties you would like to exclude.

OR

  • You can create an entirely new Sequence Action that you can add right before the SEND action and filters the response you are sending.

For either task, this Doc shows how to implement a Sequence Action and customize the sequence. http://loopback.io/doc/en/lb4/Sequence.html

Let me know if this helps you accomplish what you were trying to accomplish / if I can help further.

@dhmlau
Copy link
Member

dhmlau commented Apr 20, 2018

In discussion with @raymondfeng , there are 2 things we can consider:

  1. need infrastructure to support the declarative approach for defining models and allows the "hide" property
  2. another possibility is to provide pluggability of actions (in the form of extensions) to allow application developers to plug in some transform for the response.

@dhmlau dhmlau removed the non-DP3 label Aug 23, 2018
@stale
Copy link

stale bot commented Sep 17, 2019

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Sep 17, 2019
@stale
Copy link

stale bot commented Oct 17, 2019

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Oct 17, 2019
@shadyanwar
Copy link

@virkt25 @dhmlau It would be great if we could re-open this issue.

@dougal83 dougal83 reopened this Dec 29, 2019
@stale stale bot removed the stale label Dec 29, 2019
@agnes512
Copy link
Contributor

agnes512 commented Jan 24, 2020

#3453 (comment) might relate to this issue.

@agnes512
Copy link
Contributor

Please check Hidden property section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants