OAuth2.Serializer behaviour (OAuth2 v2.1.1)

View Source

A serializer is responsible for encoding/decoding request/response bodies.

Example

defmodule MyApp.JSON do
  def encode!(data), do: Jason.encode!(data)
  def decode!(binary), do: Jason.decode!(binary)
end

Summary

Callbacks

decode!(binary)

@callback decode!(binary()) :: map()

encode!(map)

@callback encode!(map()) :: binary()