Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[GENERATOR ISSUE] Parse nullable option in additionalProperites

Abierto
#67 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
julia, openapi
Área
tooling

Línea de trabajo

Comienza con la ruta del generador que convierte additionalProperties de la especificación OpenAPI de HubSpot en el campo properties de Julia generado. Reproduce el caso de análisis de valores Nullable utilizando la especificación enlazada; se considera terminado cuando el modelo generado acepta valores null sin un error de análisis.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Julia
Estrellas
56
Forks
16
Merge medio
1 d 51 min
PR fusionados (30 d)
12

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de JuliaComputing/OpenAPI.jl

Todos los issues de JuliaComputing/OpenAPI.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.