Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Error when posting an object

未关闭
#8 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
ruby
领域
backend

调研方向

从 lib/microsoft_kiota_abstractions/request_information.rb 第 101 行开始,此处 set_content_from_parsable 在 POST 对象时引发 NameError。重新现现 POST 请求,并验证 content 在没有未定义的 this 引用的情况下被赋值。对象可以在没有此错误的情况下完成 POST 即表示完成。

由索引模型根据 Issue 内容生成。

描述

/home/jasonjoh/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/microsoft_kiota_abstractions-0.13.0/lib/microsoft_kiota_abstractions/request_information.rb:101:in set_content_from_parsable': undefined local variable or method this' for #<MicrosoftKiotaAbstractions::RequestInformation:0x00007feeaa6523e0 @headers=#<MicrosoftKiotaAbstractions::RequestHeaders:0x00007feeaa6523b8 @headers={"Accept"=>["application/json"], "Content-Type"=>["application/json"]}>, @query_parameters={}, @path_parameters={"baseurl"=>"https://jsonplaceholder.typicode.com"}, @url_template="{+baseurl}/posts{?userId*,title*}", @http_method=:POST> (NameError)

    this.content = writer.get_serialized_content();
    ^^^^

https://github.com/microsoft/kiota-abstractions-ruby/blob/feb925f02a35c159352f6da5be454b9c38d357c3/lib/microsoft_kiota_abstractions/request_information.rb#L101

I believe this should be changed to:

@content = writer.get_serialized_content();
主要语言
Ruby
星标
5
派生
12
平均合并
1 天 8 小时
30 天内合并 PR
23

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/kiota-ruby 的其他 Issue

查看 microsoft/kiota-ruby 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。