ashb commented on code in PR #74084:
URL: https://github.com/apache/airflow/pull/74084#discussion_r4237948339


##########
task-sdk/src/airflow/sdk/importers/yaml_importer/schema.json:
##########
@@ -0,0 +1,361 @@
+{
+  "$defs": {
+    "ConstRef": {
+      "additionalProperties": false,
+      "description": "Force a literal; the value is taken verbatim.",
+      "oneOf": [
+        {
+          "required": [
+            "$const"
+          ]
+        }
+      ],
+      "properties": {
+        "$const": {
+          "title": "$Const"
+        }
+      },
+      "title": "ConstRef",
+      "type": "object"
+    },
+    "Task": {
+      "additionalProperties": true,
+      "anyOf": [

Review Comment:
   I think this is where Pydantic gets this wrong, and when generating client 
code I often have to fix it, so lets fix this here.
   
   anyOf is 1 _or more_ of these schemas must match. This is not what we 
actually want, as it wants to be an exclusive or choice.
   
   I've had to fix this in FastAPI with custom openapi hook schema. I think we 
need that same change here, all `anyOf` should be converted to `oneOf`.
   
   Future client work will thank us.



-- 
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