-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): exports json schema (#2362)
## Describe your changes Fixes https://linear.app/nango/issue/NAN-1154/produce-json-schema-locally Fixes https://linear.app/nango/issue/NAN-1155/upload-json-schema-when-deploying - Output `schema.ts` and `schema.json` in `.nango/` folder We decided to not output additional stuff at the root level to avoid cluttering the main folder. Customers can choose what they to commit. And we will add more output in the coming weeks/months (most likely zod, then others languages maybe) - Rename `load` to `loadValidateParse` For clarification because it wasn't super obvious it could fail with validation error. - Touch a bit deploy.service to prepare new files to be sent but the logic is the same as before (not yet sending json)
- Loading branch information
1 parent
0c80bfd
commit a40e180
Showing
24 changed files
with
560 additions
and
206 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,82 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`generate function tests > should init the expected files in the nango-integrations directory 1`] = ` | ||
"// --------------------------- | ||
// This file was generated by Nango (vTest) | ||
// You can version this file | ||
// --------------------------- | ||
export interface GithubIssue { | ||
id: number; | ||
owner: string; | ||
repo: string; | ||
issue_number: number; | ||
title: string; | ||
author: string; | ||
author_id: string; | ||
state: string; | ||
date_created: Date; | ||
date_last_modified: Date; | ||
}; | ||
" | ||
`; | ||
|
||
exports[`generate function tests > should init the expected files in the nango-integrations directory 2`] = ` | ||
"{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/GithubIssue", | ||
"definitions": { | ||
"GithubIssue": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "number" | ||
}, | ||
"owner": { | ||
"type": "string" | ||
}, | ||
"repo": { | ||
"type": "string" | ||
}, | ||
"issue_number": { | ||
"type": "number" | ||
}, | ||
"title": { | ||
"type": "string" | ||
}, | ||
"author": { | ||
"type": "string" | ||
}, | ||
"author_id": { | ||
"type": "string" | ||
}, | ||
"state": { | ||
"type": "string" | ||
}, | ||
"date_created": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"date_last_modified": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"owner", | ||
"repo", | ||
"issue_number", | ||
"title", | ||
"author", | ||
"author_id", | ||
"state", | ||
"date_created", | ||
"date_last_modified" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"$comment": "This file was generated by Nango (vTest)" | ||
}" | ||
`; |
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
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
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
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
Oops, something went wrong.