Skip to content

Commit

Permalink
Publish v2.9 schema
Browse files Browse the repository at this point in the history
  • Loading branch information
alombarte committed Jan 17, 2025
1 parent 9ed9c48 commit f77a651
Show file tree
Hide file tree
Showing 100 changed files with 22,509 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/validate-json-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- name: Ensure JSON Schemas are valid with respect to their metaschemas
run: jsonschema metaschema --ignore test --verbose
- name: Run JSON Schema unit tests
run: jsonschema test ./test/v2.8 --resolve v2.8
run: jsonschema test ./test/v2.9 --resolve v2.9
- name: Create a unified bundle
run: jsonschema bundle v2.8/_root.json --resolve v2.8 --without-id > v2.8/krakend.json
run: jsonschema bundle v2.9/_root.json --resolve v2.9 --without-id > v2.9/krakend.json
- name: Format bundle file
run: jsonschema fmt v2.8/krakend.json
run: jsonschema fmt v2.9/krakend.json
- uses: EndBug/add-and-commit@v9
with:
# The arguments for the `git add` command (see the paragraph below for more info)
# Default: '.'
add: 'v2.8/krakend.json'
add: 'v2.9/krakend.json'
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all build test

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

all: build test
Expand Down
2,330 changes: 2,330 additions & 0 deletions test/v2.9/all.json

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions test/v2.9/backend.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"description": "Backend object test",
"target": "https://www.krakend.io/schema/v2.9/backend.json",
"tests": [
{
"description": "Empty host",
"data": {
"host": [""],
"url_pattern": "/__debug/root"
},
"valid": false
},
{
"description": "Simple backend declaration with no host",
"data": {
"url_pattern": "/__debug/root"
},
"valid": true
},
{
"description": "Simple backend declaration with host",
"data": {
"url_pattern": "/__debug/root",
"host": [
"amqp://blah"
]
},
"valid": true
},
{
"description": "Simple backend declaration with empty string host",
"data": {
"url_pattern": "/__debug/root",
"host": [
""
]
},
"valid": false
},
{
"description": "Simple backend declaration with no pattern",
"data": {
"host": [
"http://foo"
]
},
"valid": false
},
{
"description": "Backend declaration with a few components",
"data": {
"host": [
"http://127.0.0.1:8080"
],
"input_headers": [
"Accept"
],
"url_pattern": "/__debug/",
"extra_config": {
"auth/ntlm": {
"user": "user",
"password": "pass"
},
"auth/gcp": {
"audience": "https://gcptest-76fewi6rca-uc.a.run.app",
"credentials_file": "/etc/krakend/gcp.json",
"custom_claims": {
"a": 1
}
},
"backend/http": {
"return_error_code": true,
"@extra_comment": "here"
},
"backend/soap": {
"path": "./path/to.xml",
"content_type": "application/xml",
"debug": false
},
"modifier/body-generator": {
"content_type": "application/json",
"debug": false,
"template": "abcdef"
},
"modifier/response-body-generator": {
"content_type": "application/json",
"debug": false,
"template": "abcdef"
}
}
},
"valid": true
}
]
}
39 changes: 39 additions & 0 deletions test/v2.9/documentation/postman.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"description": "Postman test",
"target": "https://www.krakend.io/schema/v2.9/documentation/postman.json",
"tests": [
{
"description": "Valid Postman collection at the service level",
"data": {
"name": "Postman doc",
"description": "This is a **sample** server. You can find out more about at [http://blah](http://blah.blah.com) webpage",
"version": "0.3.0",
"folder": [
{
"name": "/Users",
"description": "User endpoints. **in markdown**"
},
{
"name": "/Users/Assets",
"description": "User assets endpoints. **in markdown**"
},
{
"name": "/Books",
"description": "Books endpoints. **in markdown**"
}
]
},
"valid": true
},
{
"description": "Semantic versioning test valid",
"data": { "version": "0.3.0" },
"valid": true
},
{
"description": "Semantic versioning test invalid",
"data": { "version": "v0.3.0" },
"valid": false
}
]
}
22 changes: 22 additions & 0 deletions test/v2.9/documentation/postman_endpoint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"description": "Postman test",
"target": "https://www.krakend.io/schema/v2.9/documentation/postman_endpoint.json",
"tests": [
{
"description": "Valid Postman collection at the endpoint level",
"data": {

"name": "List users",
"folder": "/Users",
"description": "Some description"

},
"valid": true
},
{
"description": "Empty namespace is valid",
"data": { },
"valid": true
}
]
}
59 changes: 59 additions & 0 deletions test/v2.9/e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"description": "E2E test",
"target": "https://www.krakend.io/schema/v2.9/e2e.json",
"tests": [
{
"description": "Full test-case",
"data": {
"@comment": "Makes sure that the debug endpoint returns a status ok",
"in": {
"method": "GET",
"url": "http://localhost:8080/__debug/something",
"header": {
"User-Agent": "krakend e2e tool"
}
},
"out": {
"status_code": 200,
"body": "http://localhost:8080/__debug/something",
"header": {
"content-type": [
"application/json; charset=utf-8"
],
"Cache-Control": [
""
],
"X-Krakend-Completed": [
"true"
]
},
"schema": {
"title": "A JSON schema",
"description": "some description",
"type": "object",
"properties": {
"abc": {
"type": "array"
}
}
}
},
"next": [
{
"in": {
"method": "GET",
"url": "http://localhost:8080/test/rate-limit-stateless",
"header": {
"User-Agent": "krakend e2e tool"
}
},
"out": {
"status_code": 503
}
}
]
},
"valid": true
}
]
}
38 changes: 38 additions & 0 deletions test/v2.9/flexible_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"description": "Flexible config test",
"target": "https://www.krakend.io/schema/v2.9/flexible_config.json",
"tests": [
{
"description": "Full test-case",
"data": {
"@comment": "Makes sure that the debug endpoint returns a status ok",
"settings": {
"paths": [
"settings"
],
"allow_overwrite": true,
"dir_field_prefix": "",
"allowed_suffixes": [
".yaml",
".json"
]
},
"partials": {
"paths": [
"partials"
]
},
"templates": {
"paths": [
"templates"
]
},
"meta_key": "meta",
"out": "result.json",
"debug": true
},
"valid": true,
"keys_naming_rules": "strict"
}
]
}
18 changes: 18 additions & 0 deletions test/v2.9/modifier/jmespath.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"description": "JMESPath",
"target": "https://www.krakend.io/schema/v2.9/modifier/jmespath.json",
"tests": [
{
"description": "the empty object is invalid",
"data": {},
"valid": false
},
{
"description": "example expression",
"data": {
"expr": "students[?age > `18` ].name"
},
"valid": true
}
]
}
68 changes: 68 additions & 0 deletions test/v2.9/modifier/martian.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"description": "martian",
"target": "https://www.krakend.io/schema/v2.9/modifier/martian.json",
"tests": [
{
"description": "two modifiers without group are not possible",
"data": {
"header.Blacklist": {
"scope": [
"response"
],
"names": [
"Vary",
"Etag",
"Last-Modified",
"Expires"
]
},
"header.Modifier": {
"scope": [
"response"
],
"name": "Cache-Control",
"value": "max-age=600, public",
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds."
}
},
"valid": false
},
{
"description": "two modifiers in a group are possible",
"data": {
"fifo.Group": {
"scope": [
"response"
],
"aggregateErrors": true,
"modifiers": [
{
"header.Blacklist": {
"scope": [
"response"
],
"names": [
"Vary",
"Etag",
"Last-Modified",
"Expires"
]
}
},
{
"header.Modifier": {
"scope": [
"response"
],
"name": "Cache-Control",
"value": "max-age=600, public",
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds."
}
}
]
}
},
"valid": true
}
]
}
Loading

0 comments on commit f77a651

Please sign in to comment.