Skip to content

feat: 导入导出配置支持 .meta 文件,修复 yaml 格式识别问题#288

Open
lly835 wants to merge 1 commit intonacos-group:masterfrom
lly835:feat/import-export-config-type
Open

feat: 导入导出配置支持 .meta 文件,修复 yaml 格式识别问题#288
lly835 wants to merge 1 commit intonacos-group:masterfrom
lly835:feat/import-export-config-type

Conversation

@lly835
Copy link

@lly835 lly835 commented Feb 26, 2026

修复 #280

问题: nacos 导出的配置文件导入到 r-nacos 时,yaml 格式被识别成 txt。

原因: nacos 导出的 zip 中包含 .meta 文件记录配置类型信息(如 {"type":"yaml"}),r-nacos 之前忽略了这些文件,仅通过文件扩展名检测类型。

改动:

  • 导入: 先解析 .meta 文件获取 config type,优先使用 .meta 中的类型,回退到文件扩展名检测
  • 导出: 为非 text 类型的配置生成 .meta 文件,兼容 nacos 导出格式
  • ConfigInfoDto 新增 config_type 字段,导出时携带类型信息

修复 nacos-group#280: nacos 导出的配置文件导入到 r-nacos 时,yaml 格式被识别成 txt。

原因:nacos 导出的 zip 中包含 .meta 文件记录配置类型信息,r-nacos 之前忽略了这些文件。

改动:
- 导入:先解析 .meta 文件获取 config type,优先使用 .meta 中的类型,回退到文件扩展名检测
- 导出:为非 text 类型的配置生成 .meta 文件,兼容 nacos 导出格式
- ConfigInfoDto 新增 config_type 字段,导出时携带类型信息
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants