Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[GENERATOR ISSUE] Parse nullable option in additionalProperites

Đang mở
#67 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
julia, openapi
Lĩnh vực
tooling

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ả

stale

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaComputing/OpenAPI.jl

Tất cả issue của JuliaComputing/OpenAPI.jl

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.