json2typescript - Convert JSON to TypeScript with secure type checking!

  •        166

In Angular 2 applications, everyone consumes JSON API's from an external source. Type checking and object mapping is only possible in TypeScript, but not in the JavaScript runtime. As the API may change at any point, it is important for larger projects to verify the consumed data. json2typescript is a small package containing a helper class that maps JSON objects to an instance of a TypeScript class. After compiling to JavaScript, the result will still be an instance of this class. One big advantage of this approach is, that you can also use methods of this class.

http://dhlab.unibas.ch
https://github.com/dhlab-basel/json2typescript

Tags
Implementation
License
Platform

   




Related Projects

Noggit - JSON streaming parser

  •    Java

Noggit is the world's fastest streaming JSON parser for Java. It is used in Apache Solr.

NSwag - The Swagger/OpenAPI toolchain for .NET, Web API and TypeScript.

  •    CSharp

NSwag is a Swagger/OpenAPI 2.0 and 3.0 toolchain for .NET, .NET Core, Web API, ASP.NET Core, TypeScript (jQuery, AngularJS, Angular 2+, Aurelia, KnockoutJS, and more) and other platforms, written in C#. The Swagger specification uses JSON and JSON Schema to describe a RESTful web API. The NSwag project provides tools to generate Swagger specifications from existing ASP.NET Web API controllers and client code from these Swagger specifications. The project combines the functionality of Swashbuckle (Swagger generation) and AutoRest (client generation) in one toolchain. This way a lot of incompatibilites can be avoided and features which are not well described by the Swagger specification or JSON Schema are better supported (e.g. inheritance, enum and reference handling). The NSwag project heavily uses NJsonSchema for .NET for JSON Schema handling and C#/TypeScript class/interface generation.

angular2-schema-form - HTML form generation based on JSON Schema

  •    TypeScript

Angular2 Schema Form is an Angular2 module allowing you to instanciate an HTML form from a JSON schema. Angular2 Schema Form is not related to angular-schema-form and schemaform.io.

FastEasyMapping - A tool for fast serializing & deserializing of JSON

  •    Objective-C

This is a fork of EasyMapping, a flexible and easy framework for JSON mapping. It turns out, that almost all popular libraries for JSON mapping are SLOW. The main reason for that is multiple trips to database during the lookup of existing objects. We decided to take an already existing flexible solution (i.e. EasyMapping) and improve its overall performance.

ngx-schema-form - HTML form generation based on JSON Schema

  •    TypeScript

Ngx Schema Form is an Angular 2+ module allowing you to instanciate an HTML form from a JSON schema. Note: Version 1.x is compliant with Angular <=4, version 2.x is compliant with Angular >=6.


aws-cognito-angular-quickstart - An AngularV4-based QuickStart web app utilizing Amazon Cognito, S3, and DynamoDB (serverless architecture)

  •    TypeScript

This sample application can be deployed to either Elastic Beanstalk or S3. S3 will host this application as a static site while Elastic Beanstalk gives you the capability of adding backend operations to the application.createResources.sh requires your aws cli to be configured for JSON output.

fastjson - Fast JSON Processor

  •    Java

Fastjson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Fastjson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.

jsonmapper - map nested JSON structures onto PHP classes

  •    PHP

Takes data retrieved from a JSON web service and converts them into nested object and arrays - using your own model classes. Starting from a base object, it maps JSON data on class properties, converting them into the correct simple types or objects.

Flexjson - Lightweight JSON parser

  •    Java

Flexjson is a lightweight library for serializing Java objects into JSON. What's different about Flexjson is it's control over what gets serialized allowing both deep and shallow copies of objects.

json-schema-to-typescript - Compile JSONSchema to TypeScript typings

  •    TypeScript

See server demo and browser demo for full examples. A simple CLI utility is provided with this package.

HandyJSON - A handy swift json-object serialization/deserialization library

  •    Swift

HandyJSON is a framework written in Swift which to make converting model objects( pure classes/structs ) to and from JSON easy on iOS.Compared with others, the most significant feature of HandyJSON is that it does not require the objects inherit from NSObject(not using KVC but reflection), neither implements a 'mapping' function(writing value to memory directly to achieve property assignment).

generate-schema - Convert JSON Objects to MySQL Schema, JSON Schema, Mongoose Schema, Google BigQuery, or a Generic template for Swagger files, documentation, code generation, and more

  •    Javascript

Convert JSON Objects to MySQL Table Schema, JSON Schema, Mongoose Schema, ClickHouse Schema, Google BigQuery, or a Generic template for documentation, code generation, and more. Optionally, add -g to the above if you want the generate-schema command line executable.

json11 - A tiny JSON library for C++11.

  •    C++

json11 is a tiny JSON library for C++11, providing JSON parsing and serialization.The core object provided by the library is json11::Json. A Json object represents any JSON value: null, bool, number (int or double), string (std::string), array (std::vector), or object (std::map).

Motis - Easy JSON to NSObject mapping using Cocoa's key value coding (KVC)

  •    Objective-C

Motis is a user-friendly interface with Key Value Coding that provides your NSObjects tools to map key-values stored in dictionaries into themselves. With Motis your objects will be responsible for each mapping (distributed mapping definitions) and you won't have to worry for data validation, as Motis will validate your object types for you. Check our blog post entry Using KVC to parse JSON to get a deeper idea of Motis foundations.

quicktype - Generate types and converters from JSON, Schema, and GraphQL

  •    TypeScript

quicktype generates strongly-typed models and serializers from JSON, JSON Schema, and GraphQL queries, making it a breeze to work with JSON type-safely in any programming language.

jsonparser - Alternative JSON parser for Go that does not require schema (so far fastest)

  •    Go

It does not require you to know the structure of the payload (eg. create structs), and allows accessing fields by providing the path to them. It is up to 10 times faster than standard encoding/json package (depending on payload size and usage), allocates no memory. See benchmarks below.Originally I made this for a project that relies on a lot of 3rd party APIs that can be unpredictable and complex. I love simplicity and prefer to avoid external dependecies. encoding/json requires you to know exactly your data structures, or if you prefer to use map[string]interface{} instead, it will be very slow and hard to manage. I investigated what's on the market and found that most libraries are just wrappers around encoding/json, there is few options with own parsers (ffjson, easyjson), but they still requires you to create data structures.

JSON-java - A reference implementation of a JSON package in Java

  •    Java

A reference implementation of a JSON package in Java. The files in this package implement JSON encoders/decoders in Java. It also includes the capability to convert between JSON and XML, HTTP headers, Cookies, and CDL.

json - A free, in-browser JSON to CSV converter.

  •    Javascript

A simple JSON to CSV converter that handles objects and nested documents. Conversion happens inside the browser, in straight JavaScript. It may choke on large files.

json-formatter-js - Render JSON objects in beautiful HTML (pure JavaScript)

  •    TypeScript

Render JSON objects in HTML with a collapsible navigation. JSON Formatter started as an AngularJS directive. This is pure JavaScript implementation of the same module.





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.