Comments (4)
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.
Hey @kelleyk, could you create a minimum reproducible example so that we can debug?
from ts-json-schema-generator.
hey @kelleyk can you try with @2.3.1--canary.2009.14b4e3c.0
and see if it was fixed?
from ts-json-schema-generator.
🚀 Issue was released in v2.4.0-next.0
🚀
from ts-json-schema-generator.
Related Issues (20)
- Error when following exports?
- Dist types now require @types/ts-expose-internals HOT 9
- Fix CJS imports HOT 8
- Invalid index in type HOT 11
- CLI - ENOENT: no such file or directory, open 'package.json' HOT 3
- Error: Unknown type "undefined" HOT 2
- Required types not allowed HOT 1
- Generator crashed when no package version is set HOT 4
- Any way to indicate that a string is actually a date-time? HOT 7
- Breaking changes from v1 to v2 HOT 1
- Support for `"format": "uri-reference"` HOT 3
- Incorrect typing when a type uses Omit and inherits properties from a grandparent interface
- How do you use ajv with references? HOT 4
- create schema uses `anyOf` instead of `allOf` HOT 5
- When I use discriminator, I am getting an error where it can't find the specific field HOT 1
- Allow using dependencies schema on certain prop HOT 4
- Undefined reference in ObjectLiteralExpressionNodeParser when using typeof on a spread const HOT 2
- Schema generator fails when nested property name is StringLiteral (kind 11) HOT 4
- error generating schema for keyof typeof x HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-json-schema-generator.