Contentful logo

Contentful Community

Suddenly a lot of validation errors on CreateOrUpdateContentType API method



I’ve been working with the API for some weeks now and suddenly, since yesterday, a lot of validation errors show up for missing values on types that shouldn’t even have these values set.

For example for a field with type Symbol it’s giving a Validation Error saying that the value of linkType can’t be null and needs to be either ‘Asset’ or ‘Entry’.
But this doesn’t make any sense for a Symbol field.

    "name": "in",
    "details": "Value must be one of expected values",
    "path": [
    "value": null,
    "expected": [

Update: I should say that I’m using the package. I found that this serializes the content types with fields including a null value for fields that are not set. Like this:


If I remove the linkType and items lines from the json it does work.

Did something change in the API, so it doesn’t ignore null values anymore?
A solution could be to make sure the ContentfulManagementClient doesn’t serialize the fields that are not set. Using something like NullValueHandling = NullValueHandling.Ignore in the JSON serializer settings.