Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested param #725

Closed
flaviolpgjr opened this issue Jun 12, 2018 · 2 comments
Closed

Nested param #725

flaviolpgjr opened this issue Jun 12, 2018 · 2 comments

Comments

@flaviolpgjr
Copy link

Hi, I'm trying to build the following structure, but I'm not getting success:

{
"inhabitant": {
"name": "Gabriel test",
"email": "pre@gmail.com",
"password": "abc123",
"cpf": "98672252284",
"birthday": "1989-10-21",
"facebook_id": "89",
"terms": true
}
}

@apiParam (inhabitant) {String} inhabitant.name User name.
@apiParam (inhabitant) {String} inhabitant.email User email.
@apiParam (inhabitant) {String} inhabitant.password User password, is mandatory when facebook id is not passed.
@apiParam (inhabitant) {String} inhabitant.cpf Cpf of the user.
@apiParam (inhabitant) {String} inhabitant.birthday Birth of the user.
@apiParam (inhabitant) {String} inhabitant. [facebook_id] User id of the user, it is only passed when the user will log in with facebook.
@apiParam (inhabitant) {Boolean = true, false} inhabitant.terms Whether the user accepts the terms of use or not.
the parameters are coming to me, like this:

{"inhabitant.name" => "", "inhabitant.birthday" => "", "inhabitant.password" => "", "inhabitant.cpf" => , "inhabitant." => "inhabitant.terms" => "", "controller" => "auth / users", "action" => "register"}

Thank you very much in advance.

@mrvini
Copy link

mrvini commented Jun 12, 2018

you would need to add someting like this before you define your object details
@apiparam (inhabitant) {object} inhabitant

@flaviolpgjr
Copy link
Author

I got a different friend

  @apiParam (inhabitant) {String} inhabitant [name] Username.
  @apiParam (inhabitant) {String} inhabitant [email] User email.
  @apiParam (inhabitant) {String} inhabitant [password] User password is mandatory when facebook id is not passed.
  @apiParam (inhabitant) {String} inhabitant [cpf] Cpf of the user.
  @apiParam (inhabitant) {String} inhabitant [birthday] Birth of the user.

But anyway, thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants