API Platform version(s) affected: 4.3.17
Description
The symfony constraint validators e.g. Symfony\Component\Validator\Constraints\NotBlankValidator receive array value by default. Because of that if we pass empty string then validation does not work. Is this a bug or a feature?
How to reproduce
parameters: [
'foo' => new HeaderParameter(
required: true,
constraints: [new NotBlank(message: 'foo missing from header')]
),
],
Possible Solution
parameters: [
'foo' => new HeaderParameter(
required: true,
constraints: [new NotBlank(message: 'foo missing from header')],
nativeType: new BuiltinType(typeIdentifier: TypeIdentifier::STRING)
),
],
Additional Context
MR to improve doc: api-platform/docs#2322
API Platform version(s) affected: 4.3.17
Description
The symfony constraint validators e.g.
Symfony\Component\Validator\Constraints\NotBlankValidatorreceive array value by default. Because of that if we pass empty string then validation does not work. Is this a bug or a feature?How to reproduce
parameters: [ 'foo' => new HeaderParameter( required: true, constraints: [new NotBlank(message: 'foo missing from header')] ), ],Possible Solution
parameters: [ 'foo' => new HeaderParameter( required: true, constraints: [new NotBlank(message: 'foo missing from header')], nativeType: new BuiltinType(typeIdentifier: TypeIdentifier::STRING) ), ],Additional Context
MR to improve doc: api-platform/docs#2322