mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-06-08 06:03:55 +02:00
only modify key parts of schemas/community_submission.v1.schema.json schema. Lowest diffs
This commit is contained in:
@@ -58,18 +58,9 @@ def generate_updated_schema(base_schema: dict, tag_registry: dict[str, str]) ->
|
|||||||
for tag_name, type_name in sorted(tag_registry.items()):
|
for tag_name, type_name in sorted(tag_registry.items()):
|
||||||
tag_properties[tag_name] = type_name_to_json_schema(type_name)
|
tag_properties[tag_name] = type_name_to_json_schema(type_name)
|
||||||
|
|
||||||
# Update tags definition
|
# Only add/update the properties key within tags, preserve everything else
|
||||||
schema["properties"]["tags"] = {
|
if "properties" in schema and "tags" in schema["properties"]:
|
||||||
"type": "object",
|
schema["properties"]["tags"]["properties"] = tag_properties
|
||||||
"description": "Community-defined tags. New tags can be added, but must use consistent types.",
|
|
||||||
"propertyNames": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
|
||||||
},
|
|
||||||
"properties": tag_properties,
|
|
||||||
# Still allow additional properties for new tags
|
|
||||||
"additionalProperties": {"$ref": "#/$defs/tagValue"}
|
|
||||||
}
|
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user