Closed retgoat closed 7 years ago
you can try to make a custom type Any
like this:
defmodule Maru.Types.Any do
use Maru.Type
def parse(input, _), do: input
end
and set type: Any
will make Any
a internal type 🙂
@falood thanks man!
@falood Maybe it deserves to be included in maru? Just in case.
map
and list
without do block
will return the original value now, I think it's better than Any
type.
here's an example: https://github.com/elixir-maru/maru/blob/c804d517b2e04f13f76aa69a262a1342c644a064/test/builder/route_test.exs#L84-L112
Hi there! I need to pass some unstructured json document as
content_type
param like this:content_type
can be any json with any fields. When Im usingMap
as param typeThen params parses as empty map
%{}
. But if I set param type toJson
,%Maru.Exceptions.InvalidFormat
I'm getting%Maru.Exceptions.InvalidFormat
. Here is the code:The main question is: how can I allow to push any json document as
content_type
parameter? Thanks in advance!