implemented type match checking for types on schema id instead of type const
This commit is contained in:
@ -761,3 +761,45 @@ pub fn title_override_schemas() -> JsonB {
|
||||
|
||||
cache_json_schemas(jsonb(enums), jsonb(types), jsonb(puncs))
|
||||
}
|
||||
|
||||
pub fn type_matching_schemas() -> JsonB {
|
||||
let enums = json!([]);
|
||||
let types = json!([
|
||||
{
|
||||
"name": "entity",
|
||||
"schemas": [{
|
||||
"$id": "entity",
|
||||
"type": "object",
|
||||
"properties": { "type": { "type": "string" }, "name": { "type": "string" } },
|
||||
"required": ["type", "name"]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"name": "job",
|
||||
"schemas": [{
|
||||
"$id": "job",
|
||||
"$ref": "entity",
|
||||
"properties": { "job_id": { "type": "string" } },
|
||||
"required": ["job_id"]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"name": "super_job",
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "super_job",
|
||||
"$ref": "job",
|
||||
"properties": { "manager_id": { "type": "string" } },
|
||||
"required": ["manager_id"]
|
||||
},
|
||||
{
|
||||
"$id": "super_job.short",
|
||||
"$ref": "super_job",
|
||||
"properties": { "name": { "maxLength": 10 } }
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
let puncs = json!([]);
|
||||
cache_json_schemas(jsonb(enums), jsonb(types), jsonb(puncs))
|
||||
}
|
||||
Reference in New Issue
Block a user