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

Potential bug when using wildcard in API filter functionality

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
julia
领域
api, tooling

调研方向

首先阅读 OpenAPI/src/json.jl,以及在报告的 property_type 调用处生成的 model_WellOrInaccessibleResource.jl,然后跟踪 Plate 响应如何在 OpenAPI/src/client.jl 中被反序列化。如果可能,重现 wildcard 响应;完成的标准是,使用 returning="wells.*.webURL" 的响应不再因缺少 resourceType 键而失败。

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

描述

stale

I run into an error in the code generated by OpenAPI.jl. The API I'm trying to use accepts a "returning" input string (https://docs.benchling.com/docs/getting-started-1#returning-query-parameter) which is a comma separated list of (potentially nested) return values (e.g. "a.b.c"), which can be used to limit the returning payload. This keyword accepts a wildcard to return all values at that level, but when I use the wildcard I get an error.

I don't know where to start debugging this as the code is autogenerated by OpenAPI. Moreover, the API needs authentication so it is hard to cook up a reproducible example.

Here is the auto generated code https://github.com/jonalm/BenchlingRestApi.jl

And this line https://github.com/jonalm/BenchlingRestApi.jl/blob/0294435467c1d57124d2d85956d383839fc3dd21/codegen/src/models/model_WellOrInaccessibleResource.jl#L17 errors:

ERROR: KeyError: key "resourceType" not found

The following code triggers the error

api_return, http_resp = get_plate(
    PlatesApi(client), 
    arrayspecsubplateid,
    returning="wells.*.webURL" # should limit the payload
)
ERROR: KeyError: key "resourceType" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:498 [inlined]
  [2] property_type(::Type{BioMe.Benchling.RestApi.WellOrInaccessibleResource}, name::Symbol, json::Dict{String, Any})
    @ BioMe.Benchling.RestApi ~/dev/BioMe.jl/src/Benchling/RestApi/src/models/model_WellOrInaccessibleResource.jl:17
  [3] from_json(o::BioMe.Benchling.RestApi.WellOrInaccessibleResource, name::Symbol, json::Dict{String, Any})
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:64
  [4] from_json
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:46 [inlined]
  [5] from_json
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:40 [inlined]
  [6] convert
    @ ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:712 [inlined]
  [7] setindex!(h::Dict{String, BioMe.Benchling.RestApi.WellOrInaccessibleResource}, v0::Dict{String, Any}, key::String)
    @ Base ./dict.jl:376
  [8] Dict{String, BioMe.Benchling.RestApi.WellOrInaccessibleResource}(kv::Dict{String, Any})
    @ Base ./dict.jl:84
  [9] convert
    @ Base ./abstractdict.jl:568 [inlined]
 [10] from_json
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:41 [inlined]
 [11] from_json(::Type{Union{Nothing, Dict{…}}}, json::Dict{String, Any})
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:39
 [12] from_json(o::BioMe.Benchling.RestApi.Plate, name::Symbol, json::Dict{String, Any})
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:65
 [13] from_json(o::BioMe.Benchling.RestApi.Plate, json::Dict{String, Any})
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:58
 [14] from_json(o::T, json::Dict{String, Any}) where T<:OpenAPI.APIModel
    @ OpenAPI ~/.julia/packages/OpenAPI/p5UeR/src/json.jl:40 [inlined]
 [15] response
    @ ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:422 [inlined]
 [16] response(::Type{BioMe.Benchling.RestApi.Plate}, is_json::Bool, body::Vector{UInt8})
    @ OpenAPI.Clients ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:411
 [17] response(::Type{BioMe.Benchling.RestApi.Plate}, resp::Downloads.Response, body::Vector{UInt8})
    @ OpenAPI.Clients ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:406
 [18] exec(ctx::OpenAPI.Clients.Ctx, stream_to::Nothing)
    @ OpenAPI.Clients ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:628
 [19] exec
    @ OpenAPI.Clients ~/.julia/packages/OpenAPI/p5UeR/src/client.jl:608 [inlined]
 [20] #get_plate#1549
    @ BioMe.Benchling.RestApi ~/dev/BioMe.jl/src/Benchling/RestApi/src/apis/api_PlatesApi.jl:143 [inlined]
 [21] top-level scope
    @ ~/dev/BioMe.jl/scratch/scratch3.jl:77
Some type information was truncated. Use `show(err)` to see complete types.
主要语言
Julia
星标
56
派生
16
平均合并
1 天 51 分钟
30 天内合并 PR
12

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

JuliaComputing/OpenAPI.jl 的其他 Issue

查看 JuliaComputing/OpenAPI.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

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