将 YAML 文件转换为 Application.properties [英] Convert YAML file to Application.properties
本文介绍了将 YAML 文件转换为 Application.properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何将 YAML 文件转换为 Application.properties?
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}'
有什么工具可以在线将 YAML 转换为 app.properties 吗?
Is there any tool to convert YAML to app.properties online?
推荐答案
我使用 python 脚本.
只需克隆并运行:
$ python yaml2props.py {your_path_file}
注意
在我在 Ubuntu 18.04 上的特定情况下,我必须安装 pyperclip 库并使用 python3,所以:
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}
这篇关于将 YAML 文件转换为 Application.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文