*Context*: NelmioApiDocBundle does not require clients to have the symfony/validator package. However it requires it in its dev dependencies.
*Problem*: If client of library does not have symfony/validator and uses PHP8, NelmioApiDocBundle will assume that symfony/validator is installed, in `SymfonyConstraintAnnotationReader.php`
*Solution*: We should not assume that client has symfony/validator. So before reading attributes of this class, we now try to see if class exists.
- Tests still run.
- Tested in a project without symfony/validator and requiring this version, it now works.
The error before this fix was :
Exception: `ClassNotFound`
Message for me: `Attempted to load class "Constraint" from namespace "Symfony\Component\Validator".
Did you forget a "use" statement for e.g. "JsonSchema\Constraints\Constraint" or "Doctrine\DBAL\Schema\Constraint"?`
*Context*: NelmioApiDocBundle does not require clients to have the symfony/validator package. However it requires it in its dev dependencies.
*Problem*: If client of library does not have symfony/validator and uses PHP8, NelmioApiDocBundle will assume that symfony/validator is installed, in `SymfonyConstraintAnnotationReader.php`
*Solution*: We should not assume that client has symfony/validator. So before reading attributes of this class, we now try to see if class exists.
- Tests still run.
- Tested in a project without symfony/validator and requiring this version, it now works.
The error before this fix was :
Exception: `ClassNotFound`
Message for me: `Attempted to load class "Constraint" from namespace "Symfony\Component\Validator".
Did you forget a "use" statement for e.g. "JsonSchema\Constraints\Constraint" or "Doctrine\DBAL\Schema\Constraint"?`
When using serializer context groups in JMS serializer, even if just using the Default group in one place explicitly and leaving it blank in another, they will be treated as different component schemas, even though to the serializer outcome they are the same.
Documenting behavior of decision with side effect.
Previously it was possible to set only one of the min or max values and
get a schema like:
"property": {
"type": "integer",
"minimum": 1,
"maximum": 0
}
Also possible that `Range` would be used with {min,max}PropertyPath and
you'd get a schema with both minimum and max set to zero.
With the checks in place, that's no longer the case.
It's possible to set a count constraint with a min but no max, which
would generate an OpenAPI Schema like...
"property": {
"type": "array",
"minItems": 1,
"maxItems": 0
}
With this change the schema will only set `minItems` in that example.