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

why not use jms serializer? #753

Closed
videni opened this issue Jul 10, 2018 · 2 comments
Closed

why not use jms serializer? #753

videni opened this issue Jul 10, 2018 · 2 comments

Comments

@videni
Copy link

@videni videni commented Jul 10, 2018

why api platform doesn't use jms serailzier? jms serializer provides more features , such as version and its faster than Symfony one.

@dunglas

This comment has been minimized.

Copy link
Member

@dunglas dunglas commented Jul 10, 2018

For several reasons:

  • Its internal design fits more with what API Platform needs internally (chain pattern instead of visitor)
  • The Symfony Serializer benefits from the release policy, Backward Compatibility promise and time-based releases of Symfony
  • 2 people of the API Platform Core Team are also proud members of the Symfony Core Team (including me). It means that we're never "blocked", we can merge the features and fixes we need easily in the Symfony Serializer
  • JMSSerializer has been unmaintained in the past (it's not the case anymore), and it would have been a huge issue for API Platform. The truck factor for the Symfony Serializer is currently better
  • And the main historical reason: when API Platform has been started, JMS Serializer was licensed under Apache v2. This license wasn't in sync with API Platform's goals because it isn't compatible with GPLv2 (used by ezPublish, Drupal, phpBB...). The license of JMSSerializer v2 changed recently to MIT (same as Symfony), so it isn't an issue anymore

And according to the latest benchmarks, Symfony Serializer is faster, but that's not very interesting because both are very fast anyway.
Regarding features, the Symfony one has features not available in JMS Serializer (YAML and CSV support, type checking, smart property access - most of them have been contributed for API Platform actually) while JMS Serializer also has some features still lacking in the Symfony one (nicer annotations-based high level config).

To learn more about the Symfony Serializer, how it works and all its features: https://dunglas.fr/2018/05/mastering-the-symfony-serializer-php-tour-slides/

@dunglas dunglas closed this Jul 10, 2018
@videni

This comment has been minimized.

Copy link
Author

@videni videni commented Jul 12, 2018

@dunglas , thanks for you very detail explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.