filmov
tv
Validating JSON with TypeScript Interfaces; JSON Schema, TSDoc

Показать описание
Signal Advisors sends out thousands of notifications to their customers trusting that templates have proper data. This talk walks through how to use TypeScript interfaces with JSDoc (TSDoc) tags to generate schemas and build with confidence.
03:08 defining payload schemas with TypeScript
04:18 the Signal Advisors use case
05:11 converting TypeScript to JSON Schema
07:08 overview of the example repo for this talk
07:50 example 1: two simple interface properties
12:08 example 2: nested interfaces
15:01 example 3: extending interfaces and type literal unions
20:13 example 4a: date formatting validation
22:29 example 4b: email validation
22:59 example 4c: minLength and maxLength on strings
25:09 audience question: how do you publish the schemas?
25:46 audience question: do the 3rd party services have access to the TypeScript types?
27:04 audience question: do you version the schemas?
28:11 audience question: why did you do code-first rather than spec-first?
29:17 audience question: how expressive is JSON Schema compared to TypeScript?
30:00 audience question: what made you use this particular npm?
30:27 audience question: did you look into OpenAPI for this use case?
31:43 audience question: are you also autogenerating documentation from the JSON Schema?
33:01 audience question: do you have anything in CI that runs the schemas against the templates?
Ryan Burr is Director of Engineering at Signal Advisors and a TypeScript enthusiast.
03:08 defining payload schemas with TypeScript
04:18 the Signal Advisors use case
05:11 converting TypeScript to JSON Schema
07:08 overview of the example repo for this talk
07:50 example 1: two simple interface properties
12:08 example 2: nested interfaces
15:01 example 3: extending interfaces and type literal unions
20:13 example 4a: date formatting validation
22:29 example 4b: email validation
22:59 example 4c: minLength and maxLength on strings
25:09 audience question: how do you publish the schemas?
25:46 audience question: do the 3rd party services have access to the TypeScript types?
27:04 audience question: do you version the schemas?
28:11 audience question: why did you do code-first rather than spec-first?
29:17 audience question: how expressive is JSON Schema compared to TypeScript?
30:00 audience question: what made you use this particular npm?
30:27 audience question: did you look into OpenAPI for this use case?
31:43 audience question: are you also autogenerating documentation from the JSON Schema?
33:01 audience question: do you have anything in CI that runs the schemas against the templates?
Ryan Burr is Director of Engineering at Signal Advisors and a TypeScript enthusiast.
Комментарии