O'Reilly logo

JavaScript JSON Cookbook by Ray Rischpater

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

Introduction

While some say that strong types are for weak minds, the truth is that strong typing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required