Comments (4)
old version which I designed, I think we can drop it.
local schema = {
-- num1 = 0,
num2 = "num",
num3 = "int",
-- num4 = {0, max = 100, min = 10},
num5 = {"int", range={1, 10}, max = 10, min = 1, default = 2},
-- str1 = "",
str2 = "string",
str3 = {"string", default = "a", max_len = 10, min_len = 1, dict = {"a", "b", "c"}},
-- bool1 = true,
bool2 = "bool",
bool3 = {"bool", default = true},
-- table1 = {},
table2 = "table",
table2 = "array",
table2 = "hash",
table3 = {"array", elements = {"int", dict={3, 4, 5}, max_len = 10, min_len = 1}},
table4 = {"hash", elements = {
-- sub schema
num2 = "num",
num3 = "int",
}},
}
-- white mode: 只允许 schema 中描述定义的 key 值,不允许有任何多余
-- black mode: 允许出现 schema 描述之外的 key 存在
local conf = {
sss = 1, -- 报错
}
from apisix.
Maybe you can try my https://github.com/tianchaijz/lua-resty-jsonschema validator.
from apisix.
https://github.com/Tencent/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp
This is also a good alternative.
from apisix.
implemented already: 1737fb7
from apisix.
Related Issues (20)
- bug: use secret can cause 500 stack error in some case. HOT 7
- bug: `jwe-decrypt` plugin secret requires exactly 32 chars HOT 5
- feat: support health check for TCP upstreams HOT 6
- help request: Getting Started Error: "400 Request Header Or Cookie Too Large" HOT 11
- bug: dns_client return recursion detected HOT 13
- help request: verfify jwt barrer token using JWK server HOT 6
- feat: Can the preheating capability be added to newly created pods? HOT 6
- docs: The source installation of previous versions of APISIX need to be updated HOT 3
- docs: argocd confusion, its not a non-Kubernetes option HOT 2
- bug: `jwe-decrypt` Authorization header not showing up HOT 3
- bug: Can't create apisix route for stream with additional labels. HOT 1
- bug: error in gPRC protocol as reverse proxy HOT 4
- apisix 不需要etcd部署 HOT 7
- How does apisix do what it says it does? HOT 15
- help request: When I use proxy_mode: http&stream configuration, only stream port works, http port doesn't work HOT 4
- feat: common dubbo-proxy plugin HOT 5
- bug: Getting Bad Request `Request Header Or Cookie Too Large` after the definition of route HOT 5
- help request: request termination HOT 2
- bug: set default buckets to plugin prometheus not working
- How does apisix integrate coraza-proxy-wasm? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apisix.