typescript-json-schema
Version:
typescript-json-schema generates JSON Schema files from your Typescript sources
30 lines (23 loc) • 534 B
text/typescript
/// <reference path="misc/dimension.ts"/>
interface Product {
/**
* Uniquely defines the product
* @pattern [A-Z][a-z][0-9]_
*/
name: string;
/** How big it is */
dimension?: Dimension;
/** Classification */
category: Category;
}
interface WeightedProduct extends Product {
weight: number;
}
interface Category {
/** Uniquely identifies the category */
name: string | number;
/** Classification level from 1 to 5 (highest)
* @type integer
*/
level: number;
}