Code Monkey home page Code Monkey logo

Comments (17)

PieterVanEde avatar PieterVanEde commented on May 18, 2024 1

I don't have the time to write some tests, could I leave that to you?

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

Hi Pieter, let me check, I'll add some additional test cases for these scenarios.

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Great! I'm currently seeing if I can make a PR to fix this.

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Weird thing is that if I look at your code, it seems valid to me, yet with even version 0.4.4 I see the behaviour is wrong.

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

@PieterVanEde Can you share you spec with me? Is that possible?

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

Or the better question: if you generate it with the default options, does everything look good then?

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Yep, after fooling around a bit, I've found the following:

  • if generated with default options, all looks fine.
  • if generated with everything set to false, the barrel file is empty (correct)
  • if generated with exportCore: true, exportModels: false, exportSchemas: false, exportServices: true, then only the core and models end up in the barrel (wrong)
  • if generated with exportCore: true, exportModels: true, exportSchemas: false, exportServices: false, then I only get the core and services in the barrel (wrong)
  • and like that I see more cases where the generate flags seem to have effect on the wrong section in the barrel file.

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

Ah maybe the parsing logic of the booleans are wrong somehow, are using the Node API or using it via command line / package json?

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

The parsing is indeed wrong, I've linked my local checkout of my fork inside my test project, and added this to the top of the index.hbs:

{{#if exportCore}} // pieter was here: exportCore true {{/if}} {{#if exportModels}} // pieter was here: exportModels true {{/if}} {{#if exportSchemas}} // pieter was here: exportSchemas true {{/if}} {{#if exportServices}} // pieter was here: exportServices true {{/if}}

Result for config exportCore: true, exportModels: false, exportSchemas: false, exportServices: true, is core and models

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

I'm using the typescript interface to call the library

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Strangely enough, only the barrel file is wrong. The actual files that are output, are correct.

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Error spotted, PR on its way

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

PR is created, hope you agree ;)

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

Cool, thanks for spotting this, stupid mistake, will push a new version to npm now

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

Pushed 0.4.5

from openapi-typescript-codegen.

ferdikoomen avatar ferdikoomen commented on May 18, 2024

I re-opend this as a reminder to add some test cases

from openapi-typescript-codegen.

PieterVanEde avatar PieterVanEde commented on May 18, 2024

Great! And well, there is a stupid mistake in a great library that I could use for free, so I don't see a problem ;)

from openapi-typescript-codegen.

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.