mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-06-18 10:40:07 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70aa5869c0 | |||
| 83c3406699 | |||
| fecf9ff0ea | |||
| 7e0a396fc7 |
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"contributor_name": "hellohello",
|
||||
"contributor_uuid": "2981c3ee-8712-5f96-84bf-732eda515a3f",
|
||||
"creation_timestamp": "2026-02-12T21:02:32.325360+00:00",
|
||||
"registration_number": "N12345",
|
||||
"tags": {
|
||||
"airshows": true,
|
||||
"cat_friendly": false,
|
||||
"dog_friendly": true,
|
||||
"notes": "is a pet carrier"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
[
|
||||
{
|
||||
"contributor_uuid": "2981c3ee-8712-5f96-84bf-732eda515a3f",
|
||||
"creation_timestamp": "2026-02-12T20:52:47.207684+00:00",
|
||||
"registration_number": "N12345",
|
||||
"tags": {
|
||||
"internet": "starlink"
|
||||
}
|
||||
},
|
||||
{
|
||||
"contributor_uuid": "2981c3ee-8712-5f96-84bf-732eda515a3f",
|
||||
"creation_timestamp": "2026-02-12T20:52:47.207684+00:00",
|
||||
"tags": {
|
||||
"internet": "viasat",
|
||||
"owner": "John Doe"
|
||||
},
|
||||
"transponder_code_hex": "ABC123"
|
||||
}
|
||||
]
|
||||
@@ -46,21 +46,27 @@
|
||||
},
|
||||
"tags": {
|
||||
"type": "object",
|
||||
"description": "Community-defined tags. New tags can be added, but must use consistent types.",
|
||||
"description": "Additional community-defined tags as key/value pairs (values may be scalar, array, or object).",
|
||||
"propertyNames": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
||||
},
|
||||
"properties": {
|
||||
"internet": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {
|
||||
"$ref": "#/$defs/tagValue"
|
||||
},
|
||||
"properties": {
|
||||
"airshows": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"cat_friendly": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"dog_friendly": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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()):
|
||||
tag_properties[tag_name] = type_name_to_json_schema(type_name)
|
||||
|
||||
# Update tags definition
|
||||
schema["properties"]["tags"] = {
|
||||
"type": "object",
|
||||
"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"}
|
||||
}
|
||||
# Only add/update the properties key within tags, preserve everything else
|
||||
if "properties" in schema and "tags" in schema["properties"]:
|
||||
schema["properties"]["tags"]["properties"] = tag_properties
|
||||
|
||||
return schema
|
||||
|
||||
|
||||
Reference in New Issue
Block a user