Skip to content

PUT, POST etc don't really take array parameters #5

Description

@mylescarrick

I'm trying to call the update courses API
https://canvas.instructure.com/doc/api/courses.html#method.courses.batch_update

It needs a courses_id param... but because the clean_params doesn't yet handle array values (see note at https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L177) I'm trying to do what the docs suggest, and send an array of arrays...

... but put, post, delete methods assume a hash (https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L150) - so they pass a string/symbol key... so they fail (of course) with:
TypeError: no implicit conversion of String into Integer

I might take a look at the clean_params implementation - or in the meantime it might be worth updating the docs, as the examples there won't work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions