You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out Directus using Docker to see if it will be a good fit for my needs.
I have a very basic project running locally.
I created one collection called payloads. The collection has one field, input, and it's set as mandatory.
Now, I'm trying to use the REST API to create an item. It won't work, it gives me an error saying the required field input is not present.
If I change the field to be optional I can create the item but the payload is not recognised.
Are you sure that you are actually sending the 'Content-Type: application/json' header? What you are describing is consistent with accidentally sending form encoded data which is not recognized by the body parser. Like, did you actually run the curl request you have provided?
Using the request you have provided I am able to successfully create items in the payloads collection.
I am going to close this issue at it seems to not be a problem with Directus itself, but I'm happy to reopen if there is new information!
Describe the Bug
Hi,
I'm trying out Directus using Docker to see if it will be a good fit for my needs.
I have a very basic project running locally.
I created one collection called
payloads
. The collection has one field,input
, and it's set as mandatory.Now, I'm trying to use the REST API to create an item. It won't work, it gives me an error saying the required field
input
is not present.If I change the field to be optional I can create the item but the payload is not recognised.
Here's the cURL request (I'm using Postman):
And the response:
To Reproduce
Start a new self-hosted project
Here's my docker-compose schema:
Create a collection
payloads
JSON
|required
)Use Postman to send a request
curl --location 'http://localhost:8055/items/payloads'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer rxRy-AS39AfvUd-1OWgHT7ZQ5OlFS5B-'
--data '{
"input": {
"test": "test"
}
}'
Directus Version
v10.11.00
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: