forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidation_basic_jsonschema.py
More file actions
39 lines (38 loc) · 1.33 KB
/
validation_basic_jsonschema.py
File metadata and controls
39 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
INPUT = {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "Sample schema",
"description": "The root schema comprises the entire JSON document.",
"examples": [{"message": "hello world", "username": "lessa"}],
"required": ["message", "username"],
"properties": {
"message": {
"$id": "#/properties/message",
"type": "string",
"title": "The message",
"examples": ["hello world"],
"maxLength": 100,
},
"username": {
"$id": "#/properties/username",
"type": "string",
"title": "The username",
"examples": ["lessa"],
"maxLength": 30,
},
},
}
OUTPUT = {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "Sample outgoing schema",
"description": "The root schema comprises the entire JSON document.",
"examples": [{"statusCode": 200, "body": "response"}],
"required": ["statusCode", "body"],
"properties": {
"statusCode": {"$id": "#/properties/statusCode", "type": "integer", "title": "The statusCode"},
"body": {"$id": "#/properties/body", "type": "string", "title": "The response"},
},
}