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

Allow conditionally hidden fields #313

Open
protestContest opened this issue Feb 22, 2024 · 1 comment
Open

Allow conditionally hidden fields #313

protestContest opened this issue Feb 22, 2024 · 1 comment

Comments

@protestContest
Copy link
Contributor

protestContest commented Feb 22, 2024

The hidden/0 view callback is handy to remove sensitive fields in views. In some cases, an API may want to hide certain fields by default, but show them in some cases (in my application's case, some fields should be visible if specifically requested as part of a sparse fieldset).

It would be handy if the hidden callback accepted conn as an argument, so the application could decide what fields to hide for a particular request.

Any thoughts on this? I'm happy to open a PR for the change.

Related issue: #68

@mattpolzin
Copy link
Member

that sounds like a reasonable solution as long as you don't need to omit any relationships (really, anything outside of attributes) conditionally. just cuz the hidden/0 function only operates on fields to begin with.

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

2 participants