Giter Club home page Giter Club logo

Comments (4)

kelleyk avatar kelleyk commented on August 19, 2024 1

Sure; sorry if I wasn't clear enough: I think that the generic-simple test input that is in this repository is a pretty decent "minimal repro".

It contains the following TypeScript type definintions:

export interface MyGeneric<T> {
    field: T;
}

export interface MyObject {
    value: MyGeneric<number>;
}

This, without --expose all, works fine.

$ npx ts-json-schema-generator --path ~/src/github.com/vega/ts-json-schema-generator/test/valid-data/generic-simple/main.ts --out /tmp/foo.json

When I add --expose all, however, I get the error that I mentioned above.

$ npx ts-json-schema-generator --path ~/src/github.com/vega/ts-json-schema-generator/test/valid-data/generic-simple/main.ts --out /tmp/foo.json --expose all
/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/ts-json-schema-generator.js:74
    throw error;
    ^

TypeError: Cannot read properties of undefined (reading 'getId')
    at new UnknownTypeError (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/Error/Errors.js:24:48)
    at ChainTypeFormatter.getTypeFormatter (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:29:15)
    at ChainTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:21:21)
    at CircularReferenceTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/CircularReferenceTypeFormatter.js:30:50)
    at /Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/ObjectTypeFormatter.js:43:59
    at Array.reduce (<anonymous>)
    at ObjectTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/ObjectTypeFormatter.js:38:44)
    at ChainTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/ChainTypeFormatter.js:21:44)
    at CircularReferenceTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/CircularReferenceTypeFormatter.js:30:50)
    at DefinitionTypeFormatter.getChildren (/Users/kelleyk/.npm/_npx/dec19a6f9609cbed/node_modules/ts-json-schema-generator/dist/src/TypeFormatter/DefinitionTypeFormatter.js:21:84)

Let me know if there's anything else you need!

from ts-json-schema-generator.

arthurfiorette avatar arthurfiorette commented on August 19, 2024

Hey @kelleyk, could you create a minimum reproducible example so that we can debug?

from ts-json-schema-generator.

arthurfiorette avatar arthurfiorette commented on August 19, 2024

hey @kelleyk can you try with @2.3.1--canary.2009.14b4e3c.0 and see if it was fixed?

from ts-json-schema-generator.

github-actions avatar github-actions commented on August 19, 2024

🚀 Issue was released in v2.4.0-next.0 🚀

from ts-json-schema-generator.

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.