mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
JSON Validation added
(1) JSON file structure altered a bit. (2) JSON validated against schema. (3) Corresponding changes in the python script. Signed-off-by: Archana <archana.madhavan@silabs.com> Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
This commit is contained in:
committed by
Asfandyar Orakzai
parent
05efa17549
commit
04cfe34639
112
scripts/data_files/driver_jsons/driver_opaque_schema.json
Normal file
112
scripts/data_files/driver_jsons/driver_opaque_schema.json
Normal file
@ -0,0 +1,112 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"prefix": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"location": {
|
||||
"type": "string"
|
||||
},
|
||||
"dependency": {
|
||||
"type": "string"
|
||||
},
|
||||
"headers": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"depend_on": {
|
||||
"type": "string"
|
||||
},
|
||||
"entry_points": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"_comment",
|
||||
"depend_on",
|
||||
"entry_points"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"depend_on": {
|
||||
"type": "string"
|
||||
},
|
||||
"entry_points": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"copy_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"get_builtin_key": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"copy_key",
|
||||
"get_builtin_key"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"_comment",
|
||||
"depend_on",
|
||||
"entry_points",
|
||||
"name"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"prefix",
|
||||
"type",
|
||||
"location",
|
||||
"dependency",
|
||||
"headers",
|
||||
"capabilities"
|
||||
]
|
||||
}
|
106
scripts/data_files/driver_jsons/driver_transparent_schema.json
Normal file
106
scripts/data_files/driver_jsons/driver_transparent_schema.json
Normal file
@ -0,0 +1,106 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"prefix": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"dependency": {
|
||||
"type": "string"
|
||||
},
|
||||
"headers": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"depend_on": {
|
||||
"type": "string"
|
||||
},
|
||||
"entry_points": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fallback": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"_comment",
|
||||
"depend_on",
|
||||
"entry_points",
|
||||
"fallback"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"depend_on": {
|
||||
"type": "string"
|
||||
},
|
||||
"entry_points": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fallback": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"export_public_key": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"export_public_key"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"_comment",
|
||||
"depend_on",
|
||||
"entry_points",
|
||||
"fallback",
|
||||
"name"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"prefix",
|
||||
"type",
|
||||
"dependency",
|
||||
"headers",
|
||||
"capabilities"
|
||||
]
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
[{
|
||||
{
|
||||
"prefix": "mbedtls_test",
|
||||
"type": "opaque",
|
||||
"location": "0x7fffff",
|
||||
"dependency": "defined(PSA_CRYPTO_DRIVER_TEST)",
|
||||
"headers": ["test/drivers/test_driver.h"],
|
||||
"capabilities": [
|
||||
{
|
||||
@ -16,4 +17,4 @@
|
||||
"name": {"copy_key":"mbedtls_test_opaque_copy_key", "get_builtin_key":"mbedtls_test_opaque_get_builtin_key"}
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
[{
|
||||
{
|
||||
"prefix": "mbedtls_test",
|
||||
"type": "transparent",
|
||||
"dependency": "defined(PSA_CRYPTO_DRIVER_TEST)",
|
||||
"headers": ["test/drivers/test_driver.h"],
|
||||
"capabilities": [
|
||||
{
|
||||
@ -18,4 +19,4 @@
|
||||
}
|
||||
|
||||
]
|
||||
}]
|
||||
}
|
||||
|
Reference in New Issue
Block a user