Coder Social home page Coder Social logo

karosli / quicktype-vscode-yymodel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doggy8088/quicktype-vscode-refresh

0.0 0.0 0.0 2.48 MB

VS Code extension to convert JSON to TypeScript, C#, Go, and many more 支持 json 转成 oc-yymodel 和 swift-yymodel 形式

Home Page: https://marketplace.visualstudio.com/items?itemName=doggy8088.quicktype-refresh

License: Apache License 2.0

Shell 9.55% TypeScript 89.60% Swift 0.84%

quicktype-vscode-yymodel's Introduction

FAQ

Q: There is already a Paste JSON as Code extension. Why do you publish a Refresh version of the same extension?

A: This extension is originally from Paste JSON as Code extension. It because the original extension is not updating since 9/20/2018, 11:48:28 PM. Many of the already fixed bugs/issues are not released. That's why I published this extension with latest version from the quicktype/quicktype-vscode repo.

Introduction

Supports TypeScript, Python, Go, Ruby, C#, Java, Swift, Rust, Kotlin, C++, Flow, Objective-C, JavaScript, Elm, and JSON Schema.

  • Interactively generate types and (de-)serialization code from JSON, JSON Schema, and TypeScript
  • Paste JSON/JSON Schema/TypeScript as code

quicktype infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. For more explanation, read A first look at quicktype.

In any JSON file, use the command "Open quicktype for JSON" to summon quicktype, which will generate types from the JSON. Invoke "Change quicktype's target language" to pick a different language. There are similar "Open quicktype" commands for JSON Schema and TypeScript.

Another way to use quicktype is to copy JSON into the clipboard and invoke "Paste JSON as code/types":

For a more powerful experience, including custom options and the ability to generate code from multiple JSON samples, try quicktype.io.

Installing

This extension is available for free in the Visual Studio Code Marketplace

Customization

  • quicktype.justTypes: Generate only types, or also produce (de)serialization code when using "Open quicktype". When using "Paste", you can pick between the commands for "types" and "code", without having to set this option.

  • quicktype.inferMaps, quicktype.inferEnums, quicktype.inferDateTimes, quicktype.inferUuids, quicktype.inferBoolStrings, quicktype.inferIntegerStrings: Tell quicktype whether it should try to infer those types from the input JSON. This is not a precise science, so sometimes the guess will be wrong, which is why you can turn them off through these options. Also, quicktype doesn't support dates, UUIDs and stringified integers/booleans in all target languages yes.

  • quicktype.pickCsharpTargetLanguage: In the .NET world, there are two popular JSON serialization/de-serialization packages. The previous version of QuickType only support for Newtonsoft.Json (a.k.a. Json.NET). This verion of Paste JSON as Code (Refresh) add support for System.Text.Json package and support DateOnly and TimeOnly type that been added from .NET 6.

Contribute!

quicktype is an open source project, and we're always happy about contributors. Due to the lack of maintainence of the original project, I forked a new one for further developments. If you can think of a way to improve this extension, or quicktype, please consider contributing, especially if you know TypeScript. Code is only one way to contribute, though: we're particularly short on documentation.

If you find a bug, please report it on GitHub.

插件市场

插件市场 https://marketplace.visualstudio.com/

发布插件教程 https://liiked.github.io/VS-Code-Extension-Doc-ZH

发布插件,需要先注册账号,去获取 Personal Access Tokens https://azure.microsoft.com/zh-cn/products/devops/

quicktype-vscode-yymodel's People

Contributors

schani avatar dvdsgl avatar doggy8088 avatar hoonoh avatar raphaklaus avatar dependabot[bot] avatar itowlson avatar

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.