elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 84 forks source link

Using identical param keys in groups results in wrong params #5

Closed tjheeta closed 9 years ago

tjheeta commented 9 years ago

For example, using the following params:

       params do                                                               
          requires :type, type: Atom, values: [:record]                         
          group :data, type: Map do                                             
            requires :name, type: String, regexp: ~r"^[a-zA-Z0-9\-\.]+$"        
            requires :type, type: String, regexp: ~r"^[a-zA-Z0-9]+$"            
          end                                                                   
        end          

Submitting this:

{data: %{name: "www", type: "a"}, type: "record"}

Will result with the following parameters:

%{data: %{name: "www", type: "record"}, type: :record}

The expected result is:

%{data: %{name: "www", type: "a"}, type: :record}
falood commented 9 years ago

Thank you. I guess the reason of the problem is the param :type, I'll fix this as soon as possible.