Skip to content

[Request]: Document entityValidator validators #2984

@pellyadolfo

Description

@pellyadolfo

Summary

I am using entityValidator to create some data validation endpoints. I found you have 2 different validators: validateEntityCreation and validateEntityUpdate in Strapi APIs

https://github.com/strapi/strapi/blob/51a63e06735da8cc160100e8b468b48bb58f84f8/packages/core/core/src/services/entity-validator/index.ts#L595

The data I try to validate exist in one Strapi instance. before I run the validation It will be exported from this source system and imported in another Strapi instance, So, i do not know if using a validateEntityCreation or a validateEntityUpdate validator.

Using Strapi v4.25.24

Why is it needed?

I am getting different results. For some field, Creation validator produces some 'uniqueness' validation errors that are not produced by Update validator, even when the value is unique and not error would be expected.

Suggested solution(s)

Document when should I validate with one or the other.

Related issue(s)/PR(s)

#2962

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions