diff --git a/lib/protox/json_decode.ex b/lib/protox/json_decode.ex index c19a6ae..5008030 100644 --- a/lib/protox/json_decode.ex +++ b/lib/protox/json_decode.ex @@ -7,7 +7,7 @@ defmodule Protox.JsonDecode do use Protox.{Float, Integer} - @spec decode!(iodata(), atom(), fun()) :: any() | no_return() + @spec decode!(iodata(), atom(), fun()) :: struct() | no_return() def decode!(input, mod, json_decode) do case json_decode.(input) do nil -> raise JsonDecodingError.new("invalid top-level null") diff --git a/lib/protox/json_message_decoder.ex b/lib/protox/json_message_decoder.ex index 33c0d98..05f5017 100644 --- a/lib/protox/json_message_decoder.ex +++ b/lib/protox/json_message_decoder.ex @@ -5,7 +5,7 @@ defprotocol Protox.JsonMessageDecoder do @doc since: "1.6.0" @fallback_to_any true - # @spec decode_message(atom(), struct()) :: struct() + @spec decode_message(struct(), any()) :: struct() def decode_message(initial_message, json) end