Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[GENERATOR ISSUE] Parse nullable option in additionalProperites

Offen
#67 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
julia, openapi
Bereich
tooling

Rechercherichtung

Beginne mit dem Generatorpfad, der additionalProperties der HubSpot OpenAPI-Spezifikation in das generierte Julia-properties-Feld umwandelt. Reproduziere den Parsing-Fall für Nullable-Werte anhand der verknüpften Spezifikation; abgeschlossen ist die Aufgabe, wenn das generierte Modell Nullwerte ohne Parsing-Fehler akzeptiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Julia
Sterne
56
Forks
16
Ø Merge
1 T. 51 Min.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus JuliaComputing/OpenAPI.jl

Alle Issues in JuliaComputing/OpenAPI.jl

Ähnliche Issues

Weitere Issues zu Julia

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.