question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No schema generated for re-exported types unless named with --type

See original GitHub issue

Hello, I want to generate JSON schema for all types imported in a file: schemas.ts

import { TestClass } from './src/test_class';
import { Task } from './src/task';
...

For a single type this works:

 ./node_modules/.bin/ts-json-schema-generator --path 'schemas.ts' --type 'TestClass'

But for all types, I get no definitions

 ./node_modules/.bin/ts-json-schema-generator --path 'schemas.ts' --type '*'

BTW, your CLI usage example might be wrong, 'my/project/**.*.ts' should be 'my/project/**/*.ts'

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
domoritzcommented, Nov 18, 2020

Yep, I can confirm the issue. We probably don’t show types that are not defined in a file and only re-exported. To fix this, you can step through the code with a debugger. Can you send a pull request?

1reaction
geletocommented, Nov 18, 2020

Still does not work

export { MyObject } from './my_object';
export { Field } from './field';

… and just in case:

import { MyObject } from './my_object';
import { Field } from './field';
export {MyObject};
export {Field};

…no luck

Read more comments on GitHub >

github_iconTop Results From Across the Web

External enums not re-exported from generated types.ts break ...
Describe the bug If external enums (either explicit mapping Role:./enums#MyRole or the new single file option #2038) used in combination ...
Read more >
[GA4] BigQuery Export schema - Analytics Help
Field name Data type Description app_info RECORD A record of information on the app. app_info.id STRING The package name or bundle ID of the app. app_info.firebase_app_id...
Read more >
How to solve the "module has no exported member" error?
Remove the line below from your statement export module Demo. and use it like export class ViewModel { constructor(public test: string) { }...
Read more >
Zapatos: Zero-Abstraction Postgres for TypeScript - Jawj
Exactly the kind of 'use SQL in typescript code with type-safety' non-ORM that ... We run npx zapatos to generate a file named...
Read more >
Common Errors with Exporting and Importing Translation Files
If it doesn't exist in the exported translation file, delete the identified key from the translation file. Invalid key: <key>. The key's translation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found