Something wrong with api v2

Running latest git checkout with everything, as far as I can tell, up to date I am seeing an issue creating an organization via API.

This is the bit of code that works (from hammer-cli-csv)

        @api.resource(:organizations).call(:create, {
            'name' => name,
            'organization' => {
                'name' => name,
                'label' => label,
                'description' => line[DESCRIPTION]
            }
        })

Note that 'name' must be both nested and unnested; having just one or the other fails with "Missing arguments for 'name'".

Please advise?

··· -- @thomasmckay


“The leader must aim high, see big, judge widely, thus setting himself apart form the ordinary people who debate in narrow confines.” ~ Charles De Gaulle

“Leadership is about making others better as a result of your presence and making sure that impact lasts in your absence.” ~ Harvard Business School

>
> Running latest git checkout with everything, as far as I can tell, up to date
> I am seeing an issue creating an organization via API.
>
> This is the bit of code that works (from hammer-cli-csv)
>
> @api.resource(:organizations).call(:create, {
> 'name' => name,
> 'organization' => {
> 'name' => name,
> 'label' => label,
> 'description' => line[DESCRIPTION]
> }
> })
>
> Note that 'name' must be both nested and unnested; having just one or the
> other fails with "Missing arguments for 'name'".
>
> Please advise?

so the error is coming from [1]. though, i do believe the apipie-bindings' error is correct.

the problem is the apidoc for organizations from foreman and katello are smashing together to cause problems.

snagging the json from my dev server (http://SAT6_SERVER/apidoc/v2/organizations/create.json), we can see that the params list show a 'name' field that is required, but also a 'name' field that is nested and required [2]

[1] https://github.com/Apipie/apipie-bindings/blob/master/lib/apipie_bindings/action.rb#L60-L63
[2] https://gist.github.com/komidore64/df0ac434876bcc25f861

··· ----- Original Message -----


@thomasmckay


“The leader must aim high, see big, judge widely, thus setting himself apart
form the ordinary people who debate in narrow confines.” ~ Charles De Gaulle

“Leadership is about making others better as a result of your presence and
making sure that impact lasts in your absence.” ~ Harvard Business School


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • adam price