spring-boot - spring-boot--application.yml-里面如何使用特殊字符#
问题描述
使用 # 符号作为注释的 Yaml 文件
YAML 中的注释看起来像这样。
################
# SCALAR TYPES #
###############
现在在属性文件中我有以下值
根#
作为密码,但使用作为注释的 yaml 文件,我该如何跳过它。
spring:
#data source connection
datasource:
url: jdbc:mysql://localhost:3306/vaquarkhan
username: rootadmin
password: root#
解决方案
YAML 中的特殊字符列表必须进行转义。
:, {, }, [, ], ,, &, *, #, ?, |, -, <, >, =, !, %, @, `
您可以引用字符串
"root#"
或使用反斜杠。
root\#
推荐阅读
- html - Div 的堆栈相互叠加
- angular - Angular NgOnChanges 行为怪异
- sql - 用于连接 2-3 列的 Sql 查询一列是数字,另一列是日期数据类型使用 Ms 访问
- next.js - 如何修复自定义 404 页面在 NextJS 中不起作用
- javascript - ApexCharts.js 折线图 - 缺失日期显示为零
- apache-kafka - SpringCloudStream Kafka如何批量消费?
- python - 将样式应用于数据框中的特定列
- javascript - 基于可变高度固定标题自动调整主要内容部分的边距顶部
- couchbase - 如何在 Couchbase 数据库的日志文件中查看查询?
- r - 拆分列 - 但前提是它包含一个或多个特殊字符