{"repo":"appvision-gmbh/json2typescript","free":true,"listed":false,"github":"https://github.com/appvision-gmbh/json2typescript","clone":"git clone https://github.com/appvision-gmbh/json2typescript.git","description":"Map JSON to a TypeScript class with secure type checking!","language":"TypeScript","stars":280,"topics":["typescript","json-api","custom-converter","map-json","json-objects","json-converter","angular","npm-package","json-typescript","ionic-framework"],"license":"MIT","category":"ui-components","readme_excerpt":"json2typescript In Angular 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. With json2typescript , only a simple function call is necessary, as demonstrated in this TypeScript snippet: Tip: All serialize() and deserialize() methods may throw an Error in case of failure. Make sure you catch errors in production! --- Changelog See the changelog in the separate file for bug fixes, new features and breaking changes: Changelog Warning: If you are reading this document on GitHub, it might be ahead of the published NPM version. Please refer to the ReadMe on NPM if in doubt. Warning: We earlier suggested to use the @JsonObject(classIdentifier) decorator, but did not enforce it. Since v1.4.0, it is mandatory to use a unique classIdentifier for every class in order to make (de)serialization work properly with class inheritance. In versions above v1.2.0 and below v1.4.0, it is possible to run into issues when not using the decorator. --- Getting started Requirements We developed json2typ","default_branch":null,"files":null,"tree":[],"storefront":"/r/appvision-gmbh","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/appvision-gmbh/json2typescript/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}