How to make object keys required in NestJS for request data validation [closed]

1 day ago 2
ARTICLE AD BOX

I need some typa way to make object keys required in the request body. Eg. HTTP 400 { error: "title is required" }. I am not using any kind of database, all data is stored in-memory and is reset whenever the server refreshes. I am using NestJS with Typescript.

Hendrick's user avatar

New contributor

Hendrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1

Read Entire Article