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.
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:
Which would generate zod schema with just
id
: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.