bugraoz93 commented on code in PR #45300:
URL: https://github.com/apache/airflow/pull/45300#discussion_r1996414322
##########
pyproject.toml:
##########
@@ -912,3 +922,30 @@ members = [
"task-sdk",
"devel-common",
]
+
+
+# To use:
+#
+# TODO: Automate this in CI to validate the unit tests with newly generated
API endpoint datamodels for compatibility
+# The FastAPI should be running in the background to serve the OpenAPI schema
+# uv run --group codegen --project apache-airflow --directory airflow/
datamodel-codegen
+[tool.datamodel-codegen]
+capitalise-enum-members=true # `State.RUNNING` not `State.running`
+disable-timestamp=true
+enable-version-header=true
+enum-field-as-literal='one' # When a single enum member, make it output a
`Literal["..."]`
+input-file-type='openapi'
+output-model-type='pydantic_v2.BaseModel'
+output-datetime-class='datetime'
+target-python-version='3.9'
+no-alias=false
+use-annotated=true
+use-default=true
+use-double-quotes=true
+use-schema-description=true # Desc becomes class doc comment
+use-standard-collections=true # list[] not List[]
+use-subclass-enum=true # enum, not union of Literals
+use-union-operator=false # 3.9+annotations
+
+url = "http://0.0.0.0:9091/openapi.json"
Review Comment:
Yeah, things have been changed a bit :) I will update it and will regenerate
the datamodels form top and adopt to operations
--
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]