-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
www/resources/template/integration/typescript_description.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The TypeScript TypeSchema integration uses only interfaces to describe the JSON payload. | ||
Note TypeScript is a special case since with TypeScript we only describe the JSON payload | ||
we don`t actually parse the JSON payload and transform it into actual objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* A simple student struct | ||
*/ | ||
export interface Student { | ||
firstName?: string | ||
lastName?: string | ||
age?: number | ||
} |
5 changes: 5 additions & 0 deletions
5
www/resources/template/integration/typescript_integration.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const student: Student = JSON.parse('{...}'); | ||
|
||
const output = JSON.stringify(student); | ||
|
||
console.log(output); |