Skip to content

Commit 57c3f19

Browse files
authored
Merge pull request #59 from krakend/dev-v2.9-community
Publish v2.9 schema
2 parents 9ed9c48 + 22fd878 commit 57c3f19

File tree

100 files changed

+22509
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+22509
-11
lines changed

.github/workflows/validate-json-schema.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- name: Ensure JSON Schemas are valid with respect to their metaschemas
1616
run: jsonschema metaschema --ignore test --verbose
1717
- name: Run JSON Schema unit tests
18-
run: jsonschema test ./test/v2.8 --resolve v2.8
18+
run: jsonschema test ./test/v2.9 --resolve v2.9
1919
- name: Create a unified bundle
20-
run: jsonschema bundle v2.8/_root.json --resolve v2.8 --without-id > v2.8/krakend.json
20+
run: jsonschema bundle v2.9/_root.json --resolve v2.9 --without-id > v2.9/krakend.json
2121
- name: Format bundle file
22-
run: jsonschema fmt v2.8/krakend.json
22+
run: jsonschema fmt v2.9/krakend.json
2323
- uses: EndBug/add-and-commit@v9
2424
with:
2525
# The arguments for the `git add` command (see the paragraph below for more info)
2626
# Default: '.'
27-
add: 'v2.8/krakend.json'
27+
add: 'v2.9/krakend.json'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: all build test
22

3-
VERSION:="v2.8"
3+
VERSION:="v2.9"
44
BIN:="docker run -it -v \"${PWD}:/workspace\" jsonschema"
55

66
all: build test

test/v2.9/all.json

Lines changed: 2330 additions & 0 deletions
Large diffs are not rendered by default.

test/v2.9/backend.json

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"description": "Backend object test",
3+
"target": "https://www.krakend.io/schema/v2.9/backend.json",
4+
"tests": [
5+
{
6+
"description": "Empty host",
7+
"data": {
8+
"host": [""],
9+
"url_pattern": "/__debug/root"
10+
},
11+
"valid": false
12+
},
13+
{
14+
"description": "Simple backend declaration with no host",
15+
"data": {
16+
"url_pattern": "/__debug/root"
17+
},
18+
"valid": true
19+
},
20+
{
21+
"description": "Simple backend declaration with host",
22+
"data": {
23+
"url_pattern": "/__debug/root",
24+
"host": [
25+
"amqp://blah"
26+
]
27+
},
28+
"valid": true
29+
},
30+
{
31+
"description": "Simple backend declaration with empty string host",
32+
"data": {
33+
"url_pattern": "/__debug/root",
34+
"host": [
35+
""
36+
]
37+
},
38+
"valid": false
39+
},
40+
{
41+
"description": "Simple backend declaration with no pattern",
42+
"data": {
43+
"host": [
44+
"http://foo"
45+
]
46+
},
47+
"valid": false
48+
},
49+
{
50+
"description": "Backend declaration with a few components",
51+
"data": {
52+
"host": [
53+
"http://127.0.0.1:8080"
54+
],
55+
"input_headers": [
56+
"Accept"
57+
],
58+
"url_pattern": "/__debug/",
59+
"extra_config": {
60+
"auth/ntlm": {
61+
"user": "user",
62+
"password": "pass"
63+
},
64+
"auth/gcp": {
65+
"audience": "https://gcptest-76fewi6rca-uc.a.run.app",
66+
"credentials_file": "/etc/krakend/gcp.json",
67+
"custom_claims": {
68+
"a": 1
69+
}
70+
},
71+
"backend/http": {
72+
"return_error_code": true,
73+
"@extra_comment": "here"
74+
},
75+
"backend/soap": {
76+
"path": "./path/to.xml",
77+
"content_type": "application/xml",
78+
"debug": false
79+
},
80+
"modifier/body-generator": {
81+
"content_type": "application/json",
82+
"debug": false,
83+
"template": "abcdef"
84+
},
85+
"modifier/response-body-generator": {
86+
"content_type": "application/json",
87+
"debug": false,
88+
"template": "abcdef"
89+
}
90+
}
91+
},
92+
"valid": true
93+
}
94+
]
95+
}

test/v2.9/documentation/postman.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"description": "Postman test",
3+
"target": "https://www.krakend.io/schema/v2.9/documentation/postman.json",
4+
"tests": [
5+
{
6+
"description": "Valid Postman collection at the service level",
7+
"data": {
8+
"name": "Postman doc",
9+
"description": "This is a **sample** server. You can find out more about at [http://blah](http://blah.blah.com) webpage",
10+
"version": "0.3.0",
11+
"folder": [
12+
{
13+
"name": "/Users",
14+
"description": "User endpoints. **in markdown**"
15+
},
16+
{
17+
"name": "/Users/Assets",
18+
"description": "User assets endpoints. **in markdown**"
19+
},
20+
{
21+
"name": "/Books",
22+
"description": "Books endpoints. **in markdown**"
23+
}
24+
]
25+
},
26+
"valid": true
27+
},
28+
{
29+
"description": "Semantic versioning test valid",
30+
"data": { "version": "0.3.0" },
31+
"valid": true
32+
},
33+
{
34+
"description": "Semantic versioning test invalid",
35+
"data": { "version": "v0.3.0" },
36+
"valid": false
37+
}
38+
]
39+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"description": "Postman test",
3+
"target": "https://www.krakend.io/schema/v2.9/documentation/postman_endpoint.json",
4+
"tests": [
5+
{
6+
"description": "Valid Postman collection at the endpoint level",
7+
"data": {
8+
9+
"name": "List users",
10+
"folder": "/Users",
11+
"description": "Some description"
12+
13+
},
14+
"valid": true
15+
},
16+
{
17+
"description": "Empty namespace is valid",
18+
"data": { },
19+
"valid": true
20+
}
21+
]
22+
}

test/v2.9/e2e.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"description": "E2E test",
3+
"target": "https://www.krakend.io/schema/v2.9/e2e.json",
4+
"tests": [
5+
{
6+
"description": "Full test-case",
7+
"data": {
8+
"@comment": "Makes sure that the debug endpoint returns a status ok",
9+
"in": {
10+
"method": "GET",
11+
"url": "http://localhost:8080/__debug/something",
12+
"header": {
13+
"User-Agent": "krakend e2e tool"
14+
}
15+
},
16+
"out": {
17+
"status_code": 200,
18+
"body": "http://localhost:8080/__debug/something",
19+
"header": {
20+
"content-type": [
21+
"application/json; charset=utf-8"
22+
],
23+
"Cache-Control": [
24+
""
25+
],
26+
"X-Krakend-Completed": [
27+
"true"
28+
]
29+
},
30+
"schema": {
31+
"title": "A JSON schema",
32+
"description": "some description",
33+
"type": "object",
34+
"properties": {
35+
"abc": {
36+
"type": "array"
37+
}
38+
}
39+
}
40+
},
41+
"next": [
42+
{
43+
"in": {
44+
"method": "GET",
45+
"url": "http://localhost:8080/test/rate-limit-stateless",
46+
"header": {
47+
"User-Agent": "krakend e2e tool"
48+
}
49+
},
50+
"out": {
51+
"status_code": 503
52+
}
53+
}
54+
]
55+
},
56+
"valid": true
57+
}
58+
]
59+
}

test/v2.9/flexible_config.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"description": "Flexible config test",
3+
"target": "https://www.krakend.io/schema/v2.9/flexible_config.json",
4+
"tests": [
5+
{
6+
"description": "Full test-case",
7+
"data": {
8+
"@comment": "Makes sure that the debug endpoint returns a status ok",
9+
"settings": {
10+
"paths": [
11+
"settings"
12+
],
13+
"allow_overwrite": true,
14+
"dir_field_prefix": "",
15+
"allowed_suffixes": [
16+
".yaml",
17+
".json"
18+
]
19+
},
20+
"partials": {
21+
"paths": [
22+
"partials"
23+
]
24+
},
25+
"templates": {
26+
"paths": [
27+
"templates"
28+
]
29+
},
30+
"meta_key": "meta",
31+
"out": "result.json",
32+
"debug": true
33+
},
34+
"valid": true,
35+
"keys_naming_rules": "strict"
36+
}
37+
]
38+
}

test/v2.9/modifier/jmespath.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"description": "JMESPath",
3+
"target": "https://www.krakend.io/schema/v2.9/modifier/jmespath.json",
4+
"tests": [
5+
{
6+
"description": "the empty object is invalid",
7+
"data": {},
8+
"valid": false
9+
},
10+
{
11+
"description": "example expression",
12+
"data": {
13+
"expr": "students[?age > `18` ].name"
14+
},
15+
"valid": true
16+
}
17+
]
18+
}

test/v2.9/modifier/martian.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"description": "martian",
3+
"target": "https://www.krakend.io/schema/v2.9/modifier/martian.json",
4+
"tests": [
5+
{
6+
"description": "two modifiers without group are not possible",
7+
"data": {
8+
"header.Blacklist": {
9+
"scope": [
10+
"response"
11+
],
12+
"names": [
13+
"Vary",
14+
"Etag",
15+
"Last-Modified",
16+
"Expires"
17+
]
18+
},
19+
"header.Modifier": {
20+
"scope": [
21+
"response"
22+
],
23+
"name": "Cache-Control",
24+
"value": "max-age=600, public",
25+
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds."
26+
}
27+
},
28+
"valid": false
29+
},
30+
{
31+
"description": "two modifiers in a group are possible",
32+
"data": {
33+
"fifo.Group": {
34+
"scope": [
35+
"response"
36+
],
37+
"aggregateErrors": true,
38+
"modifiers": [
39+
{
40+
"header.Blacklist": {
41+
"scope": [
42+
"response"
43+
],
44+
"names": [
45+
"Vary",
46+
"Etag",
47+
"Last-Modified",
48+
"Expires"
49+
]
50+
}
51+
},
52+
{
53+
"header.Modifier": {
54+
"scope": [
55+
"response"
56+
],
57+
"name": "Cache-Control",
58+
"value": "max-age=600, public",
59+
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds."
60+
}
61+
}
62+
]
63+
}
64+
},
65+
"valid": true
66+
}
67+
]
68+
}

0 commit comments

Comments
 (0)