# JSON schema
Check data Valide
# Genreate JSON schema from Typescript interface
1. install
```
npm install typescript-json-schema -g
```
2. genreate
```
cd src/workbench/browser/src/app/shared/services/storage/db/models
//genrate apidata --ignoreErrors
typescript-json-schema "apiData.ts" 'ApiData' -o "../schema/apiData.json"
//genrate env
typescript-json-schema "index.ts" 'Environment' -o "../schema/env.json"
```
3. compare and merge
The generated rule verification is not strict enough and needs to be merged manually
# Check
```javascript
const ajv = new Ajv({
useDefaults: true,
});
const validate = ajv.compile < ApiData > apiDataSchema;
if (validate(apiData)) {
return { validate: true, data: apiData };
} else {
return { validate: false, error: validate.errors };
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
postcat-main.zip
共568个文件
ts:313个
scss:58个
js:52个
1 下载量 37 浏览量
2023-03-17
17:17:27
上传
评论
收藏 1.48MB ZIP 举报
温馨提示
Postcat 是一个可扩展的 API 工具平台。 Postcat 集合基础的 API 管理和测试功能,并且可以通过插件简化你的 API 开发工作,让你可以更快更好地创建 API。
资源推荐
资源详情
资源评论
收起资源包目录
postcat-main.zip (568个子文件)
postcat.bmp 10KB
ts.code-snippets 773B
commit-msg 116B
variables.css 606B
.editorconfig 245B
.editorconfig 245B
.eslintignore 367B
.eslintignore 367B
.gitattributes 538B
.gitignore 937B
.gitignore 712B
.gitignore 13B
.gitignore 5B
.gitkeep 0B
api-test.component.html 9KB
websocket.component.html 7KB
api-edit.component.html 7KB
extension-detail.component.html 6KB
api-detail.component.html 5KB
api.component.html 5KB
api-group-tree.component.html 5KB
index.html 4KB
extension-list.component.html 4KB
project-setting.component.html 4KB
tab.component.html 3KB
table-pro.component.html 3KB
api-test-body.component.html 3KB
api-test-result-response.component.html 3KB
project-list.component.html 3KB
api-edit-body.component.html 2KB
api-script.component.html 2KB
workspace-overview.component.html 2KB
navbar.component.html 2KB
extension.component.html 2KB
extension-select.component.html 2KB
env-list.component.html 2KB
eo-history.component.html 2KB
env-edit.component.html 1KB
api-params-extra-setting.component.html 1KB
params-import.component.html 1KB
toolbar.component.html 1KB
pages.component.html 1KB
sidebar.component.html 884B
grpc.component.html 881B
api-test-result-request-body.component.html 724B
api-mock.component.html 715B
api-detail-body.component.html 701B
api-group-edit.component.html 677B
nav-breadcrumb.component.html 628B
monaco-editor.component.html 509B
api-test-result-header.component.html 382B
page-not-found.component.html 234B
page-blank.component.html 84B
graph-ql-test.component.html 28B
icon.icns 7KB
logo.ico 113KB
icon.ico 9KB
iconpark.js 97KB
mineType.package.js 76KB
unit.js 35KB
apiUtil.js 32KB
contextify.js 30KB
exec_worker_thread.js 22KB
getFile.package.js 19KB
encrypt.js 18KB
main.js 14KB
sandbox.js 14KB
http.package.js 12KB
data_constructor.js 11KB
windowsCodeSign.js 10KB
common.js 10KB
protocolcheck.js 8KB
xml.js 5KB
getVSCodeThemes.js 5KB
replaceCssVariable.js 4KB
.eslintrc.js 4KB
.eslintrc.js 4KB
zlib.js 4KB
commitlint.config.js 4KB
socketio.js 3KB
redirect.js 3KB
build.js 3KB
stylelint.config.js 2KB
stylelint.config.js 2KB
upload.js 2KB
publish.js 2KB
angular.webpack.js 2KB
grpc_client.js 1KB
deployWindows.js 1KB
main.js 1KB
karma.conf.js 1KB
unit.js 885B
beforeNSISBuild.js 874B
forkUnit.js 789B
cli.js 718B
donkey.config.js 701B
tifa.config.js 643B
unlinkComponents.js 593B
debugComponents.js 591B
afterInstall.js 529B
共 568 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
m0_72731342
- 粉丝: 2
- 资源: 1832
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 分布式系统开发环境搭建极速教程(java)
- JavaParser java-symbol-solver 使用官方文档
- 3.1软件过程概念.pptx
- 2024年微信小程序省市区街道联动Mysql数据库
- Delphi 12 控件之kbmMemTable Pro 7.74 Delphi 2009-XE12 with Source C
- 330980db72adc7fc2ad65ca590f8025e.jpg
- 基于 Spring Boot 编写出的统一返回数据结构处理和统一异常处理的插件
- 9e43d092f11676e4211b39c319a04910.pdf
- 三维显示控件(仅C++和C#部分文件代码,非完整项目文件)
- Fine Report-不同筛选框功能演示
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功