bugraoz93 commented on code in PR #42782:
URL: https://github.com/apache/airflow/pull/42782#discussion_r1797702742


##########
airflow/api_fastapi/openapi/v1-generated.yaml:
##########
@@ -155,7 +155,7 @@ paths:
         required: false
         schema:
           type: string
-          default: dag_id
+          default: ''

Review Comment:
   I have included a solution that works fine for only SortParam cases. I'm 
unsure if we want to generalise the approach for all dynamic default values for 
method parameters. In that case, we may need a more sophisticated parsing 
mechanism for method signatures. I think this can work until we have another 
exceptional case. If that is so, we can see better how to approach multiple use 
cases of updating the openapi specs. 
   
   I have checked if we can somehow include additional parameters to APIRoute 
via injecting similar to AirflowRouter implementation. It needs more than 
overriding a method from the APIRouter class 
([add_api_route](https://github.com/fastapi/fastapi/blob/master/fastapi/routing.py#L881))
 and including a custom APIRoute class. So I am not sure if we should spend 
more time fitting a dynamic solution to include this information to the FastAPI 
objects which would be then cascaded to openapi spec in the implementation.
   
   What do you think?



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