mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-08-04 15:38:35 +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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
"title": "PlaneQuery Aircraft Community Submission (v1)",
|
"title": "PlaneQuery Aircraft Community Submission (v1)",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"registration_number": {
|
"registration_number": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -17,7 +16,6 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
"contributor_uuid": {
|
"contributor_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uuid"
|
"format": "uuid"
|
||||||
@@ -28,14 +26,12 @@
|
|||||||
"maxLength": 150,
|
"maxLength": 150,
|
||||||
"description": "Display name (may be blank)"
|
"description": "Display name (may be blank)"
|
||||||
},
|
},
|
||||||
|
|
||||||
"creation_timestamp": {
|
"creation_timestamp": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"description": "Set by the system when the submission is persisted/approved.",
|
"description": "Set by the system when the submission is persisted/approved.",
|
||||||
"readOnly": true
|
"readOnly": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"start_date": {
|
"start_date": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date",
|
"format": "date",
|
||||||
@@ -48,7 +44,6 @@
|
|||||||
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
||||||
"description": "Optional end date for when this submission's tags are valid (ISO 8601, e.g., 2025-07-03)."
|
"description": "Optional end date for when this submission's tags are valid (ISO 8601, e.g., 2025-07-03)."
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags": {
|
"tags": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Additional community-defined tags as key/value pairs (values may be scalar, array, or object).",
|
"description": "Additional community-defined tags as key/value pairs (values may be scalar, array, or object).",
|
||||||
@@ -56,38 +51,76 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
||||||
},
|
},
|
||||||
"additionalProperties": { "$ref": "#/$defs/tagValue" }
|
"additionalProperties": {
|
||||||
|
"$ref": "#/$defs/tagValue"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"airshows": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"cat_friendly": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"dog_friendly": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"notes": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
{
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{ "required": ["registration_number"] },
|
{
|
||||||
{ "required": ["transponder_code_hex"] },
|
"required": [
|
||||||
{ "required": ["planequery_airframe_id"] }
|
"registration_number"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"required": [
|
||||||
|
"transponder_code_hex"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"required": [
|
||||||
|
"planequery_airframe_id"
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"$defs": {
|
"$defs": {
|
||||||
"tagScalar": {
|
"tagScalar": {
|
||||||
"type": ["string", "number", "integer", "boolean", "null"]
|
"type": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"integer",
|
||||||
|
"boolean",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"tagValue": {
|
"tagValue": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{ "$ref": "#/$defs/tagScalar" },
|
{
|
||||||
|
"$ref": "#/$defs/tagScalar"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"maxItems": 50,
|
"maxItems": 50,
|
||||||
"items": { "$ref": "#/$defs/tagScalar" }
|
"items": {
|
||||||
|
"$ref": "#/$defs/tagScalar"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"maxProperties": 50,
|
"maxProperties": 50,
|
||||||
"additionalProperties": { "$ref": "#/$defs/tagScalar" }
|
"additionalProperties": {
|
||||||
|
"$ref": "#/$defs/tagScalar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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