[GENERATOR ISSUE] Parse nullable option in additionalProperites
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với đường dẫn generator chuyển đổi additionalProperties của đặc tả HubSpot OpenAPI thành trường properties Julia được sinh ra. Tái hiện trường hợp phân tích giá trị Nullable bằng đặc tả được liên kết; hoàn tất khi model được sinh ra chấp nhận các giá trị null mà không có lỗi phân tích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi, I'm trying to generate julia client for hubspot api, and there is such a component:
"SimplePublicObjectWithAssociations": {
"type": "object",
"properties": {
...
"properties": {
"example": {
"amount": "1500.00",
"closedate": "2019-12-07T16:50:06.678Z",
"hubspot_owner_id": "910901",
"dealname": "Custom data integrations",
"dealstage": "presentationscheduled",
"pipeline": "default"
},
"additionalProperties": {
"nullable": true,
"type": "string"
},
"type": "object"
},
}
...
}
So openapi-generator generate such model:
Base.@kwdef mutable struct SimplePublicObjectWithAssociations <: OpenAPI.APIModel
archivedAt::Union{Nothing, ZonedDateTime} = nothing
archived::Union{Nothing, Bool} = nothing
properties::Union{Nothing, Dict{String, String}} = nothing
id::Union{Nothing, String} = nothing
updatedAt::Union{Nothing, ZonedDateTime} = nothing
associations::Union{Nothing, Dict} = nothing # spec type: Union{ Nothing, Dict{String, CollectionResponseAssociatedId} }
createdAt::Union{Nothing, ZonedDateTime} = nothing
propertiesWithHistory::Union{Nothing, Dict{String, Vector{ValueWithTimestamp}}} = nothing
# ...
end
There is a field properties which is of type Dict{String,String}. So it processes the type field in additionalProperties to detect String, but it doesn't process the nullable field. So if I have a property with a null value, it throws an error on parsing. I was able to fix it by changing the type to Dict{String,Union{Nothing, String}}, so maybe there is a way to update generator to process the nullable option
Edit:
Full openapi_specification: https://api.hubspot.com/api-catalog-public/v1/apis/crm/v3/objects/deals
- Ngôn ngữ chính
- Julia
- Star
- 56
- Fork
- 16
- Merge trung bình
- 1 ngày 51 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JuliaComputing/OpenAPI.jl
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
JuliaComputing/OpenAPI.jl#128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
JuliaComputing/OpenAPI.jl#118 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
JuliaComputing/OpenAPI.jl#117 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
JuliaComputing/OpenAPI.jl#113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stale
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
JuliaComputing/OpenAPI.jl#87 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của JuliaComputing/OpenAPI.jl
Issue tương tự
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
EnzymeAD/Enzyme-JAX#3286 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
SciML/LinearSolve.jl#1359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
EnzymeAD/ReactantNitro.jl#13 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày