Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 461 forks source link

Param validators about JSON type #515

Open songhuangcn opened 7 years ago

songhuangcn commented 7 years ago

Is there a way to validate JSON type param?

My request params is like:

{
  "user": {
    "email": "tom@a.com",
    "password": "password"
  }
}

And I tried to validate it by this:

param :user, Hash do
  param :email, String, :required => true
  param :password, String, :required => true
end

But it tell me that the user is not a Hash type, how can I solve it?

Thanks.

sasharevzin commented 2 years ago

@songhuangcn did you find a workaround?