-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Description
Node Version
22.17.0
NPM/Yarn/PNPM Version
10.18.2
Strapi Version
5.29.0
Operating System
Windows 11
Database
PostgreSQL
Javascript or Typescript
Typescript
Reproduction URL
No response
Bug Description
When trying to SAVE after creating entry for custom schema I get error: Validation error: Invalid status
This is not useful. I am unable to debug.
Steps to Reproduce
-
Spin up any local posgres db
-
Create strapi locally (use same env vars for above db)
pnpx create-strapi-app@latest my_strapi_backend --skip-cloud
- ? Do you want to use the default database (sqlite) ? (Y/n) n
- ? Choose your default database client: postgres
- ? Database name: (strapi)
- ? Host: (127.0.0.1)
- ? Port: (5432)
- ? Username: strapi
- ? Password: ******
- ? Enable SSL connection: (y/N) n
- ? Start with an example structure & data? (y/N) y
- ? Start with Typescript? (Y/n) y
- ? Install dependencies with pnpm? (Y/n) y
- ? Initialize a git repository? (Y/n) y
- ? Participate in anonymous A/B testing (to improve Strapi)? (y/N) n
- Load strapi (install dependencies and start)
- cd my_strapi_backend
- pnpm i
- pnpm dev
-
open in browser
localhost:1337 -
create local account
-
stop strapi
-
create this schema.json
src/api/example-x/content-types/example-x/schema.json
{
"kind": "collectionType",
"collectionName": "example-xs",
"info": {
"singularName": "example-x",
"pluralName": "example-xs",
"displayName": "Example X",
"description": "The main project schema."
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"unique": true,
"required": true
},
"status": {
"type": "string",
"required": false,
"unique": false,
"default": ""
},
"sections": {
"type": "component",
"repeatable": true,
"component": "common.section"
}
}
}
- create nested schema dependencies
- src/components/common/detail.json
{
"collectionName": "components_common_details",
"info": {
"displayName": "Detail",
"description": "A deeply nested piece of information."
},
"options": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"description": {
"type": "text"
}
}
}- src/components/common/section.json
{
"collectionName": "components_common_sections",
"info": {
"displayName": "Section",
"description": "A section within the project."
},
"options": {},
"attributes": {
"heading": {
"type": "string"
},
"content": {
"type": "text"
},
"details": {
"type": "component",
"repeatable": true,
"component": "common.detail"
}
}
}- restart strapi
pnpm dev - Go to - content manager > Example X > Create entry >
- add a title: example
- click Save
response
{
"data": null,
"error": {
"status": 400,
"name": "ValidationError",
"message": "Validation error: Invalid status",
"details": {}
}
}
unuseful error message.
The status should allow any string.
How to debug?
Expected Behavior
Either, it allows me to save, or I see a useful validation error message.
Logs
Code Snippets
No response
Media
No response
Additional information
No response
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.
Metadata
Metadata
Assignees
Labels
No labels