amoghrajesh commented on code in PR #60410:
URL: https://github.com/apache/airflow/pull/60410#discussion_r2695188491


##########
airflow-core/src/airflow/provider.yaml.schema.json:
##########
@@ -350,6 +350,113 @@
                     "hook-class-name": {
                         "description": "Hook class name that implements the 
connection type",
                         "type": "string"
+                    },
+                    "ui-field-behaviour": {
+                        "description": "Customizations for standard connection 
form fields",
+                        "type": "object",
+                        "properties": {
+                            "hidden-fields": {
+                                "description": "List of standard fields to 
hide in the UI",
+                                "type": "array",
+                                "items": {
+                                    "type": "string",
+                                    "enum": ["description", "host", "port", 
"login", "password", "schema", "extra"]
+                                },
+                                "default": []
+                            },
+                            "relabeling": {
+                                "description": "Map of field names to custom 
labels",
+                                "type": "object",
+                                "additionalProperties": {
+                                    "type": "string"
+                                },
+                                "default": {}
+                            },
+                            "placeholders": {
+                                "description": "Map of field names to 
placeholder text",
+                                "type": "object",
+                                "additionalProperties": {
+                                    "type": "string"
+                                },
+                                "default": {}
+                            }
+                        },
+                        "additionalProperties": false
+                    },
+                    "conn-fields": {
+                        "description": "Custom connection fields stored in 
Connection.extra JSON",
+                        "type": "object",
+                        "additionalProperties": {
+                            "type": "object",
+                            "properties": {
+                                "type": {
+                                    "type": "string",
+                                    "enum": ["string", "integer", "boolean", 
"number"],
+                                    "description": "Field data type"
+                                },
+                                "label": {
+                                    "type": "string",
+                                    "description": "Display label for the 
field"
+                                },
+                                "description": {
+                                    "type": "string",
+                                    "description": "Help text for the field"
+                                },
+                                "default": {
+                                    "description": "Default value for the 
field",
+                                    "oneOf": [
+                                        {"type": "string"},
+                                        {"type": "integer"},
+                                        {"type": "number"},
+                                        {"type": "boolean"},
+                                        {"type": "null"}
+                                    ]
+                                },
+                                "required": {
+                                    "type": "boolean",
+                                    "default": false,
+                                    "description": "Whether the field is 
required"
+                                },
+                                "sensitive": {
+                                    "type": "boolean",
+                                    "default": false,
+                                    "description": "Whether to mask field 
value (like password fields)"
+                                },
+                                "format": {
+                                    "type": "string",
+                                    "enum": ["password", "textarea", "email", 
"url", "json"],
+                                    "description": "UI rendering format hint"
+                                },
+                                "enum": {
+                                    "type": "array",
+                                    "items": {"type": "string"},
+                                    "description": "List of allowed values 
(creates dropdown)"
+                                },
+                                "range": {
+                                    "type": "array",
+                                    "items": {"type": "number"},
+                                    "minItems": 2,
+                                    "maxItems": 2,
+                                    "description": "Min and max values for 
number types [min, max]"
+                                },
+                                "pattern": {
+                                    "type": "string",
+                                    "description": "Regex pattern for 
validation"
+                                },
+                                "min-length": {
+                                    "type": "integer",
+                                    "minimum": 0,
+                                    "description": "Minimum string length"
+                                },
+                                "max-length": {
+                                    "type": "integer",
+                                    "minimum": 1,
+                                    "description": "Maximum string length"
+                                }
+                            },

Review Comment:
   I thought about it initially, but using jsonschema felt longer and much more 
verbose, but pretty good idea, let me explore it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to