Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add the YamlDriver to the chain when symfony/yaml is installed #1497

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

mbabker
Copy link
Contributor

@mbabker mbabker commented Jun 27, 2023

Q A
Bug fix? yes
New feature? no
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT

The JMS\Serializer\Metadata\Driver\YamlDriver class requires Symfony\Component\Yaml\Yaml to function. Given symfony/yaml is an optional dependency, it shouldn't be arbitrarily included in the driver chain when using the default driver factory and specifying a list of metadata paths. This PR updates the factory to check for the Yaml class before adding the YAML driver to the chain.

Copy link
Collaborator

@scyzoryck scyzoryck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution.
Looks good - I left one small comment. As I got a bit lost in the description - after approval, do you expect to merge this one to the master? :D

tests/Fixtures/AuthorDeprecatedReadOnly.php Outdated Show resolved Hide resolved
tests/Fixtures/AuthorList.php Outdated Show resolved Hide resolved
@goetas goetas closed this Aug 3, 2023
@goetas goetas reopened this Aug 3, 2023
@goetas goetas merged commit 5a5a03a into schmittjoh:master Aug 3, 2023
33 of 42 checks passed
@mbabker mbabker deleted the check-yaml-availability branch August 3, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants