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

Feature Request: Omit specific fields from model to json-schema #1551

Open
hongkongkiwi opened this issue Oct 29, 2024 · 1 comment
Open

Comments

@hongkongkiwi
Copy link

Hi there,

I'd like the option to omit some fields specifically when generating the schema.

Right now, my model contains an updatedAt field, it is compulsory, but I want to specifically exclude this from the schema as it's automatically generated from the database.

In this specific case, I know I can simply change the field to be optional, but I'd really like the option to omit specific fields, perhaps with a comment like some other validators do? Or something? That would give a little control over the json-schema without messing with the DB.

@hongkongkiwi
Copy link
Author

hongkongkiwi commented Oct 29, 2024

hmmm alternatively, perhaps it could be great to simply have a list of fields to exclude. Since you already have the exclude logic for relation fields and such, it could be nice simply to have a custom array of fields to exclude. In my case, that would also work and I think be a really useful feature, in this case I could add "updatedAt" and just ignore all references to that field.

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

1 participant