[SOLVED] PUT for content returns 200 instead of 400 when mandatory fields are missing

I’m submitting a…

  • [X] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Prerequisites

Have a schema with at least 1 mandatory field.

Current behavior

When making a PUT request with a mandatory field being null, the request is successful and updates the content. The content can then be fetched with GET or can be seen in the app with the mandatory field null.
Example of body:
{
“string”:null,
}
NOTE: the PUT request correctly returns 400 using the following body for the request
{
“string”:{
“iv”:null
}
}

Expected behavior

When making PUT request with the following body, the response should be 400.
{
“string”:null,
}

Minimal reproduction of the problem

  1. Create schema with mandatory field.
  2. Send a POST request to create content normally
  3. Send PUT request to update content to null

Environment

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [5.6.0]

Browser:

  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Thanks, I will have a look and provide a hotfix today if I can reproduce it

I had a look, but I cannot reproduce it:

But I tested it with my local version. Perhaps you can test it with dev-5897?

That is the working case, please try with the following body
{
“test”: null
}

Okay, you are right. It is only making the patch validation here.

The docker tag is dev-5906

This topic was automatically closed after 2 days. New replies are no longer allowed.