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.

export aliases are not suported

See original GitHub issue

if interfaces are not directly exported, they are not considered in the schema

This code is well working

export default interface A {...}
export interface B {...}

This one not

interface A {...}
interface B {...}

export default A;
export {B}

The problem is you didn’t consider the export of the sourceFile, but only the member of the source file, then check if they’re flagged as exported, what is not the case.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mdesousacommented, Feb 28, 2021

Getting a fix for this would be great! I’m new to ts-json-schema-generator, and was banging my head because my definitions were coming back empty since we always export at the bottom of our files. While the fix is merged, I would suggest to mention this behavior in the readme.

0reactions
cspotcodecommented, Aug 7, 2021

It looks like your fork ignores the type and topRef options, instead exporting a schema where each named export of the entrypoint .ts corresponds with a property of the schema. If .ts does export type foo = number; then the schema describes an object with property foo which must be a number.

This is certainly useful, but it must be opt-in; it can’t be the only behavior. In order to make these changes merge-able, I will need to re-enable support for type and topRef. Do you have any suggestions for the cleanest way to do that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to export a feature class field alias to a shapefile ...
No, it is not possible to export a feature class field alias to shapefiles as aliases are not supported in a shapefile. A...
Read more >
export inside alias is not working in Bash - Stack Overflow
I'm trying to do something like this. But it's not working. $ alias setroot="export ROOT=$1; export PATH=$ROOT/ ...
Read more >
Can't I define aliases (using `export`) that are in my current ...
defining the alias while in the directory directly above what I want to assign) gives a Not found error. Anything else I can...
Read more >
Error while using typescript 3.8 export aliases #17231 - GitHub
Using typescript 3.8 export aliases produces an error while building. Happens with ivy enabled as well as disabled. Minimal Reproduction.
Read more >
Alias not allowed in export script in Peoplesoft Data mover
Hi,. Could you please tell me why Peoplesoft Data mover does not allow the usage of aliases in export script? If used, it...
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