Convert YAML file to Application.properties

Myjay1516 picture Myjay1516 · Nov 12, 2018 · Viewed 19.3k times · Source

How can we convert YAML file to Application.properties?

pay.payment:
  sandbox:
   Url: https://securegw-stage//processTransaction
    callbackUrl: http://localhost:8080/pgresponse
    details:
      CHANNEL_ID: '${pay.payment.sandbox.channelid}'
      INDUSTRY_TYPE_ID: '${pay.payment.sandbox.industrytypeid}'
      CALLBACK_URL: '${pay.payment.sandbox.callbackUrl}'

Is there any tool to convert YAML to app.properties online?

Answer

Reginaldo Santos picture Reginaldo Santos · Jan 8, 2020

I dealt with the same problem using a python script.

Just clone and run:

$ python yaml2props.py {your_path_file}

Note

In my specific case on Ubuntu 18.04, I had to install pyperclip library and use python3, so:

$ pip3 install pyperclip
$ python3 yaml2props.py {your_path_file}