Can we input a multiline JSON string in the `airflow_settings.yaml` file?

Customer Question:

I can get it to work if the JSON object fits on one line and I surround it by single quotes. However, I can’t figure out how to get a JSON object spread over multiple lines to work. Is something like this supported?

My use case is that I want to put a large JSON which specifies the necessary configuration for an EMR cluster into an airflow variable, but for readability want to make it multiline.

For anyone seeing this issue - yep! This is a yaml spec thing that any yaml parser should be able to handle. The following should work:

airflow:
  connections:
    - conn_id:
      conn_type:
      conn_host:
      conn_login:
      conn_password:
      conn_port:
      conn_extra:
  pools:
    - pool_name:
      pool_slot:
      pool_description:
  variables:
    - variable_name: my_var
      variable_value: '{"key1":"key1_value",
            "key2":"key2_value"}'

That’d translate to:

yaml

Would the multiline YAML options work here? (>, >-, |, |+) E.g.

- variable_name: my_var
  variable_value: >-
    {
      "key1": "value1",
      "key2": "value2"
    }
...