Closed petitlapin closed 1 year ago
Thank you for reporting this issue !
This code is generated by the template file https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache
But the template fails to generate the string and enum
data type.
I'll take a look at this issue. But the priority is not high because the functions protocolv1_service_port_ToString
and protocolv1_service_port_FromString
are called correctly.
Welcome to investigation and contribution !
Thank you!
I'll take a look at this issue. But the priority is not high because the functions protocolv1_service_port_ToString and protocolv1_service_port_FromString are called correctly.
The issue is when we want to call these functions from another executable (if the function is supposed to be public):
if we call: v1_service_port_protocol_FromString
declared in the .h, the linker will complain because the implementation does not exist.
And if we call protocolv1_service_port_FromString
, as there is no declaration of this function (except in the .c we don't include), it does not compile.
For now, I've workarounded it by duplicating the function so it's not blocking too.
Your workaround is OK. These two functions can be called externally, although they are intended to be used internally.
This issue is gone because the data type of io.k8s.api.core.v1.ServicePort/protocol
is changed to string
in the Kubernetes v1.24 API Spec
Hi,
It seems the conversion from/to string differ in functions names: https://github.com/kubernetes-client/c/blob/7291d0a3c3e4802a19bce56e45d94b27150d8f5f/kubernetes/model/v1_service_port.h:
https://github.com/kubernetes-client/c/blob/7291d0a3c3e4802a19bce56e45d94b27150d8f5f/kubernetes/model/v1_service_port.c:
There is a
protocol
in the .c file that is not placed at the same place in the .hIf it's not generated code, I can do a PR to fix it to
v1_service_port_protocol_FromString
andv1_service_port_protocol_ToString
if needed