vt-elixir / ja_serializer

JSONAPI.org Serialization in Elixir.
Other
640 stars 148 forks source link

Considering migrating to Jason? #303

Closed franckstifler closed 5 years ago

franckstifler commented 5 years ago

Jason is said to be the fastest Elixir JSON encoder, I would like to know if migrating to it is something planned?

alanpeabody commented 5 years ago

If you configure Plug/Phoenix to use Jason then you will be using Jason. This library doesn't actually convert into JSON, just to the properly formatted map to be passed to the JSON lib of your choice.

beerlington commented 5 years ago

@franckstifler I'm personally using JaSerializer + Jason in production on Phoenix 1.4 with the following config:

config :phoenix, :json_library, Jason
config :phoenix, :format_encoders, "json-api": Jason

Edit: updated config

franckstifler commented 5 years ago

Thanks for your answers @beerlington and @alanpeabody . I whish to know if and how ja_serializer handles %Ecto.Association.NotLoaded{} structs?

beerlington commented 5 years ago

@franckstifler can you be more specific?