kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
144 stars 46 forks source link

Error when parsing int64 or double array #70

Closed ityuhui closed 3 years ago

ityuhui commented 3 years ago

Reported by @clearday4

the type of supplemental_groups is as below:

        "supplementalGroups": {
          "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID.  If unspecified, no groups will be added to any container.",
          "items": {
            "format": "int64",
            "type": "integer"
          },
          "type": "array"
        },

it is an integer array.

We suggest changing it as follows. In v1_pod_security_context.c

list_addElement(supplemental_groupsList , &supplemental_groups_local->valuedouble);

=>

double *supplemental_groups_local_values = malloc(sizeof(double));
*supplemental_groups_local_values = supplemental_groups_local->valuedouble;
list_addElement(supplemental_groupsList , supplemental_groups_local_values);
ityuhui commented 3 years ago

The fix in generator is https://github.com/OpenAPITools/openapi-generator/pull/10124

ityuhui commented 3 years ago

Fixed by #73