You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/25 08:29:29 UTC

[GitHub] [airflow] 11010cy commented on a change in pull request #21080: Fix wrong use of $ref and nullable

11010cy commented on a change in pull request #21080:
URL: https://github.com/apache/airflow/pull/21080#discussion_r791465400



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -3442,6 +3449,11 @@ components:
         - sensing
         - removed
 
+    NullableTaskState:
+      oneOf:
+        - type: null
+        - $ref: '#/components/schemas/TaskState'
+

Review comment:
       1. TaskState/TimeDelte itself can not be null, we couldn't change itself.  It is not nullable in some scenarios, like:
   ```
   # 3259~3264
   state:
             type: array
             items:
               $ref: '#/components/schemas/TaskState'
             description:
               The value can be repeated to retrieve multiple matching values (OR condition).
   ```
   
   2. As discussed in [openapi-generator](https://github.com/OpenAPITools/openapi-generator/issues/11352), the inline composed schemas has bug using tooling to generate client code. If you expect a property to be one of TaskState/TimeDelta and null, the following code also doesn't work:
   ```
   dag_run_timeout:
    oneOf:
     - type: null
     - $ref: '#/components/schemas/TimeDelta'
   ```
   
   3. Of course we could wait for the `openapi-generator` to fix the bug, but not necessarily in time. It's a trade-off.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org