Open alanpoulain opened 2 years ago
Description
In OpenApiFactory, the schema is not generated for the validation error (422): https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/OpenApi/Factory/OpenApiFactory.php#L227
OpenApiFactory
It would be nice to add it at least for Hydra. Hydra normalizes the validation error like this: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/Hydra/Serializer/ConstraintViolationListNormalizer.php#L46-L50
One way to implement it would be to add a new schema type, like TYPE_VALIDATION_ERROR here: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/JsonSchema/Schema.php#L30-L31
TYPE_VALIDATION_ERROR
And handle this new type in this method: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/Hydra/JsonSchema/SchemaFactory.php#L73
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
In
OpenApiFactory
, the schema is not generated for the validation error (422): https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/OpenApi/Factory/OpenApiFactory.php#L227It would be nice to add it at least for Hydra. Hydra normalizes the validation error like this: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/Hydra/Serializer/ConstraintViolationListNormalizer.php#L46-L50
One way to implement it would be to add a new schema type, like
TYPE_VALIDATION_ERROR
here: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/JsonSchema/Schema.php#L30-L31And handle this new type in this method: https://github.com/api-platform/core/blob/e649fa1507963102fddb339458a82c426240553b/src/Core/Hydra/JsonSchema/SchemaFactory.php#L73