Code Monkey home page Code Monkey logo

Comments (9)

ityuhui avatar ityuhui commented on July 30, 2024 1

Thank you for reporting this issue @lordgamez

from c.

brendandburns avatar brendandburns commented on July 30, 2024 1

I believe that you need to add a section here:

https://github.com/OpenAPITools/openapi-generator/blob/bd8efe2f91761df866489c16e1c17870a8c88c5f/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache#L529

That looks like:

{{#vars}}
    {{^isPrimitiveType}}
    {{#isModel}}
    {{^isEnum}}
    {{^isFreeFormObject}}{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL;
    {{/isEnum}}
    {{/isModel}}
{{/vars}}

And then remove the line here:
https://github.com/OpenAPITools/openapi-generator/blob/bd8efe2f91761df866489c16e1c17870a8c88c5f/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache#L617

Hope that helps.

from c.

brendandburns avatar brendandburns commented on July 30, 2024

cc @ityuhui

I think this is a bug in the generated code. The function is free-ing the list metadata here:

if (metadata_local_nonprim) {

but any-place that goto end is called, metadata_local_nonprim hasn't been initialized yet.

We should either initialize that to NULL at the top of the generated function, or remove that free code.

I think the right thing to do is to remove the free code, since it doesn't appear to be being used.

from c.

ityuhui avatar ityuhui commented on July 30, 2024

OK. I'll look at this code soon.

from c.

lordgamez avatar lordgamez commented on July 30, 2024

Some additional information on this is that I had the same problem with CoreV1API_listNamespace call, so the problem is not specific to listing pods.

from c.

lordgamez avatar lordgamez commented on July 30, 2024

Thanks for the help! Although I don't have any experience with OpenAPI, can you point me to some documentation how to generate the API code?

from c.

ityuhui avatar ityuhui commented on July 30, 2024

@lordgamez

I'll fix this issue according to @brendandburns' suggestion.
You don't need generate the API code by yourself unless you want to have a try. The guide can be found at #61 (comment)

from c.

lordgamez avatar lordgamez commented on July 30, 2024

Thanks @ityuhui, sorry I thought the comment was directed at me :) Still I'll check out the guide just for fun. :)

from c.

ityuhui avatar ityuhui commented on July 30, 2024

The upstream openapi-generator breaks the generating for C client recently.
Now I'm checking that issue OpenAPITools/openapi-generator#10725.

from c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.