Book Image

JavaScript JSON Cookbook

By : Ray Rischpater, Brian Ritchie, Ray Rischpater
Book Image

JavaScript JSON Cookbook

By: Ray Rischpater, Brian Ritchie, Ray Rischpater

Overview of this book

Table of Contents (17 chapters)
JavaScript JSON Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Using JSON in a Type-safe Manner

In this chapter, we build on the recipes from Chapter 1, Reading and Writing JSON on the Client, showing you how you can use strong typing in your applications with JSON using C#, Java, and TypeScript. You'll find the following recipes:

  • How to deserialize an object using Json.NET

  • How to handle date and time objects using Json.NET

  • How to deserialize an object using gson for Java

  • How to use TypeScript with Node.js

  • How to annotate simple types using TypeScript

  • How to declare interfaces using TypeScript

  • How to declare classes with interfaces using TypeScript

  • Using json2ts to generate TypeScript interfaces from your JSON