This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch v2-2-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit d5870f0d644d957654f70fee53597651a67a2d8a Author: Matt Rixman <[email protected]> AuthorDate: Wed Jan 12 23:48:35 2022 -0700 Doc: Added an enum param example (#20841) More examples makes it easier to compare our docs with the json-schema docs and figure out how they work together. I ended up doing something similar to this in my code and figured I'd contribute an example. Co-authored-by: Matt Rixman <[email protected]> (cherry picked from commit 8dc68d47048d559cf4b76874d8d5e7a5af6359b6) --- docs/apache-airflow/concepts/params.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/apache-airflow/concepts/params.rst b/docs/apache-airflow/concepts/params.rst index ef266ea..fd4a167 100644 --- a/docs/apache-airflow/concepts/params.rst +++ b/docs/apache-airflow/concepts/params.rst @@ -134,6 +134,9 @@ JSON Schema Validation # a required param which can be of multiple types "dummy": Param(type=["null", "number", "string"]), + # an enum param, must be one of three values + "enum_param": Param("foo", enum=["foo", "bar", 42]), + # a param which uses json-schema formatting "email": Param( default="[email protected]",
