typescript-json-schema icon indicating copy to clipboard operation
typescript-json-schema copied to clipboard

Discussion on the future of schema generators

Open HoldYourWaffle opened this issue 5 years ago • 10 comments

There's currently some discussion on the future of schema generators over at https://github.com/vega/ts-json-schema-generator/issues/101.

It's mostly related to uniting the 3 big (and unfortunately buggy) modules that are used for the same purpose (generating JSON schema's from TypeScript sources) together into one, (mostly) feature complete all-round generator.

These 3 modules are:

We're currently thinking about deprecating this module in favor of vega/ts-json-schema-generator somewhere in the future (for various reasons you can read in the aforementioned issue). However, nothing has really been decided yet and we would love to hear some more opinions on this matter!

HoldYourWaffle avatar Jun 01 '19 08:06 HoldYourWaffle

@domoritz I think it maybe time to make that call!

Following some of the issues here it does seem you may have subconsciously deprecated this module in favour of vega/ts-json-schema-generator. It does make sense to me to reduce redundant effort. It solved my issue and seems to have more support.

hammadzz avatar Aug 21 '20 12:08 hammadzz

The advantage of this library here is that it is a single file. Yes, I do not have the cycles to maintain this library actively but if someone wants to use it and it works for them as it, it may still be a right tool.

Having said that, some things may change over the next few months and I am open to reconsidering my decision later.

domoritz avatar Aug 21 '20 14:08 domoritz

It would be good to point somewhere because there are a lot of pending pull requests and issues. I was about to ask about supporting bigint but I see a lot of people mentioning not supporting Symbol with no answers, and most of the issues don't seem to have any answers either. Is this still active?

JavierPAYTEF avatar Apr 26 '21 21:04 JavierPAYTEF

If I'm starting a new project that requires this functionality, should I prefer this library, or would you recommend another one?

alfaproject avatar Apr 12 '23 16:04 alfaproject

vega/ts-json-schema-generator is a lot better than this one on edge cases.

I'm curious why you want to start a new project. Maybe you can help with the new one I linked to.

domoritz avatar Apr 12 '23 20:04 domoritz

I didn't mean a project to replace any of these libraries. I mean a consumer for my own application. So I guess vega/ts-json-schema-generator is what you recommend then, thanks!

alfaproject avatar Apr 12 '23 21:04 alfaproject

Yes. This repo is in maintenance mode and I personally don't fix anything and only accept prs and make releases.

domoritz avatar Apr 12 '23 23:04 domoritz

FWIW, I am working on a project where I started with this package for schema generation, then moved to ts-json-schema-generator based on this issue, where I triggered a bug there on a feature branch that this package avoids.

EDIT: minimal examples that generates an incorrect schema, in this gist.

Does anyone have recent experience with quicktype in comparison?

bdarcus avatar May 17 '23 11:05 bdarcus

quicktype appears to use @mark.probst/typescript-json-schema, which is a mysterious fork of this repo - I don't know where the source code lives. See e.g. https://github.com/glideapps/quicktype/blob/master/packages/quicktype-typescript-input/src/index.ts

tomwidmer avatar Jan 15 '24 13:01 tomwidmer

Odd. I wonder why they don't use this fork.

domoritz avatar Jan 15 '24 14:01 domoritz