mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
984 B
984 B
Configuration Options
The following configuration options can be set on ActiveModel::Serializer.config inside an initializer.
General
adapter: The adapter to use. Possible values::attributes, :json, :json_api. Default::attributes.automatic_lookup: Whether serializer should be automatically looked up or manually provided. Default:true
JSON API
jsonapi_resource_type: Whether thetypeattributes of resources should be singular or plural. Possible values::singular, :plural. Default::plural.jsonapi_include_toplevel_object: Whether to include a top level JSON API member in the response document. Default:false.- Used when
jsonapi_include_toplevel_objectistrue:jsonapi_version: The latest version of the spec the API conforms to. Default:'1.0'.jsonapi_toplevel_meta: Optional metadata. Not included if empty. Default:{}.