You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to add item validation to an array type in the schema of a Param object passed to a DAG, the UI does render a Code box instead of an Array box and does not validate the jsonschema properly.
What you think should happen instead?
It should render the same UI element as it does when there is no field "items" in the schema.
How to reproduce
@dag(schedule=None,params={"mail": Param(schema={"title": "Email addresses","type": ["array", "null"],# The following causes the issue (even "items": {} is enough)"items": {"type": "string","format": "idn-email","minLength": 5,"maxLength": 255, }, } ), },)defany_dag():
...
Test validation in REPL:
importjsonschemaschema={
"type": ["array", "null"],
"items": {
"type": "string",
"format": "idn-email",
"minLength": 5,
"maxLength": 255,
},
}
jsonschema.validate(['test@mail.com'], schema, format_checker=jsonschema.FormatChecker())
# does not raise an exceptionjsonschema.validate(['testmail.com'], schema, format_checker=jsonschema.FormatChecker())
# does raise an exception
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
Totally agree, the docs do not describe the default behavior and the schema parameter for Param.
With #39993 at least the default behavior for string arrays is switched to present the standard array textarea which should be consistent with the docs and examples
Apache Airflow version
2.9.1
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When I try to add item validation to an array type in the schema of a Param object passed to a DAG, the UI does render a Code box instead of an Array box and does not validate the jsonschema properly.
What you think should happen instead?
It should render the same UI element as it does when there is no field "items" in the schema.
How to reproduce
Test validation in REPL:
Operating System
Debian GNU/Linux 12 (bookworm)
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==8.20.0
apache-airflow-providers-celery==3.6.2
apache-airflow-providers-cncf-kubernetes==8.1.1
apache-airflow-providers-common-io==1.3.1
apache-airflow-providers-common-sql==1.12.0
apache-airflow-providers-docker==3.10.0
apache-airflow-providers-elasticsearch==5.3.4
apache-airflow-providers-fab==1.0.4
apache-airflow-providers-ftp==3.8.0
apache-airflow-providers-google==10.17.0
apache-airflow-providers-grpc==3.4.1
apache-airflow-providers-hashicorp==3.6.4
apache-airflow-providers-http==4.10.1
apache-airflow-providers-imap==3.5.0
apache-airflow-providers-microsoft-azure==10.0.0
apache-airflow-providers-mysql==5.5.4
apache-airflow-providers-odbc==4.5.0
apache-airflow-providers-openlineage==1.7.0
apache-airflow-providers-postgres==5.10.2
apache-airflow-providers-redis==3.6.1
apache-airflow-providers-sendgrid==3.4.0
apache-airflow-providers-sftp==4.9.1
apache-airflow-providers-slack==8.6.2
apache-airflow-providers-smtp==1.6.1
apache-airflow-providers-snowflake==5.4.0
apache-airflow-providers-sqlite==3.7.1
apache-airflow-providers-ssh==3.10.1
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: