- 授权协议: EPL
- 开发语言:
- 操作系统: 跨平台
- 软件首页: https://github.com/Prismatic/schema
软件介绍
Schema 是一个 Clojure(Script) 库,用来声明数据描述和验证。
代码示例:
(ns schema-examples
(:require [schema.core :as s
:include-macros true ;; cljs only
]))
(def Data
"A schema for a nested data type"
{:a {:b s/Str
:c s/Int}
:d [{:e s/Keyword
:f [s/Num]}]})
(s/validate
Data
{:a {:b "abc"
:c 123}
:d [{:e :bc
:f [12.2 13 100]}
{:e :bc
:f [-1]}]})
;; Success!
(s/validate
Data
{:a {:b 123
:c "ABC"}})
;; Exception -- Value does not match schema:
;; {:a {:b (not (instance? java.lang.String 123)),
;; :c (not (integer? "ABC"))},
;; :d missing-required-key}
随机密码生成器
多种字符组合密码
Markdown 在线编辑器
Markdown 在线编辑器
