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

Posting an object with Ruby API client results in NoMethodError #2473

Closed
jasonjoh opened this issue Mar 28, 2023 · 1 comment · Fixed by #2474
Closed

Posting an object with Ruby API client results in NoMethodError #2473

jasonjoh opened this issue Mar 28, 2023 · 1 comment · Fixed by #2474
Assignees
Labels
Ruby type:bug A broken experience WIP
Milestone

Comments

@jasonjoh
Copy link
Member

Same repro as #2471

This code:

# POST /posts
new_post = Client::Models::Post.new()
new_post.user_id = 42
new_post.title = "Testing Kiota-generated API client"
new_post.body = "Hello world!"

created_post = client.posts.post(new_post).resume
puts "Created new post with ID: #{created_post.id}"

Results in an error:

in to_post_request_information': undefined method request_adapter' for #<Client::Posts::PostsRequestBuilder...
(NoMethodError)

 request_info.set_content_from_parsable(self.request_adapter, "application/json", body)\r

Changing to this resolves the error:

request_info.set_content_from_parsable(@request_adapter, "application/json", body)
@baywet
Copy link
Member

baywet commented Mar 28, 2023

Thanks for reporting this, fixed in #2474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby type:bug A broken experience WIP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants