Code Monkey home page Code Monkey logo

Comments (5)

monolithed avatar monolithed commented on May 22, 2024

@bcherny, is there any way to convert a JSON object as is?

I mean:

let json = {
   "x": 0
}
convert('Foo', json);
interface Foo {
   x: number
}

from json-schema-to-typescript.

bcherny avatar bcherny commented on May 22, 2024

That is outside of jstt's responsibility, though you can probably use something like https://www.npmjs.com/package/generate-schema, and pipe its output into jstt.

from json-schema-to-typescript.

monolithed avatar monolithed commented on May 22, 2024

@bcherny, thanks!

from json-schema-to-typescript.

TheLarkInn avatar TheLarkInn commented on May 22, 2024

I spent a bit of time looking at how the parser works, and was curious how you might imagine a plugin system? Would this be as granular as supporting custom JSONTypes?

from json-schema-to-typescript.

bcherny avatar bcherny commented on May 22, 2024

@TheLarkInn Sorry about the delayed response. If you want a plugin system that can add support for/override handling of a particular JSONSchema node type, you'd have to add support for that node type at a few layers:

A question to start with might be: does a typical plugin need to hook into all of these steps? If not, we might want to go more granular.

I'd start by putting together a few use cases for JSON-Schema-to-TypeScript plugins. Then we can think through how to design the API (visitor pattern, or otherwise), and sketch out how the types would work to enforce compile time safety for plugins.

from json-schema-to-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.