[bug]: Required attributes are inferred as optional when generating types #23
Labels
issue: bug
Issue reporting a bug
status: intended behavior
The behavior corresponds to the specification and won't be addressed
Bug Description
Moving issue from strapi/strapi repo
Attribute types for both Content-Types and Components are set as optional, even though they're marked as required when generating the types via strapi ts:generate-types command. The issue comes from the optional operator set it here and null type here
Steps to Reproduce
Data.ContentType<'api::post.post'>
orData.Entity<'api::post.post'>
Expected Behavior
Required attributes should not be inferred as optional
Version
1.0.0
Operating System
MacOS
Runtime Environment
Node.js
Logs
No response
Media
Generated types
As you can see in the image, all fields (including required fields like
title
andseo
) are set as optional.Confirmation Checklist
The text was updated successfully, but these errors were encountered: