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

Property hiding #75

Open
bring-shrubbery opened this issue Feb 24, 2023 · 0 comments
Open

Property hiding #75

bring-shrubbery opened this issue Feb 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bring-shrubbery
Copy link

Problem

Currently you are able to hide whole models by using /// @@Gen.model(hide: true) doc string. There's no ability to hide individual properties on demand.

Suggested solution

User should be able to add a doc string to a property to hide that property, similarly to the model hiding:

model SomeModel {
  id String @id 
  /// @@Gen.property(hide: true)
  hiddenField String
}

Which would generate zod schema with just id:

const SomeModel = z.object({
  id: z.string()
});

Alternatives

This solution follows the same approach as the model hiding does, so I don't have alternative solutions here.

Additional context

I've already implemented this feature in a fork, there will be a PR for this.

@omar-dulaimi omar-dulaimi added the enhancement New feature or request label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants