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.

Parsing all types in a file with *

See original GitHub issue

Currently I use the following command to generate a schema: ts-json-schema-generator --path test.ts --type MyInterface

However, instead of just generating a schema containing MyInterface, is it possible to collect all types within test.ts and write them in to the same schema?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
andreashuber69commented, Jun 21, 2019

I see. Let’s fix the types then. Can you send a PR?

Ok, here’s the PR: https://github.com/vega/ts-json-schema-generator/pull/135

Instead of foo: X | undefined, can you use foo?: X?

I intentionally did not do that because name? in a parameter list means that the parameter is optional. Since name is not the last parameter, this would not work. So string | undefined is more consistent. Feel free to adapt if you’d rather see type?: string; in Config.

Finally, also feel free to revert commit https://github.com/vega/ts-json-schema-generator/commit/a4ce8ccd731b0fa51faef031e41ef8905d0a101a if you think this is going into the wrong direction. I’d be happy to start over.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse information and data from files with Python, Java, Ruby ...
Let's take a deep dive into parsing different data types using various tools and techniques (especially with OCR).
Read more >
Build an interface to parse text from any type of document
Build an interface to parse text from any type of document. Extract text from txt, docx, pdf, html, pptx files, and more, using...
Read more >
Best approach to parse text files that contain multiple types of ...
I need to parse some text files that have different types of delimiters (tildes, spaces, commas, pipes, caret characters).
Read more >
c# - How should I separate File Parse Classes?
I have three different classes. Generally I am creating a file parser. The classes: CustomerData - which shows text Data Model. A File...
Read more >
Parsing text files with the TextFieldParser object - Visual Basic
The TextFieldParser object allows you to parse and process very large file that are structured as delimited-width columns of text, such as log ......
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