简体   繁体   English

我将json文件导入swagger-editor,它会自动将其转换为yaml。 我该如何预防?

[英]I import a json file to swagger-editor and it automatically converts it to yaml. How do I prevent this?

I have the latest swagger-editor docker image running on my local machine. 我在本地计算机上运行了最新的swagger-editor docker映像。 I can go to localhost and view the editor there. 我可以转到localhost并在那里查看编辑器。 I have a json file that I import to the editor, and it looks like it's automatically converting it to yaml in the editor. 我有一个导入到编辑器中的json文件,它看起来像是在编辑器中自动将其转换为yaml一样。 I'm not sure how to turn this off. 我不确定如何关闭此功能。 It's also confusing because under the Edit menu I have the option to 'Convert to YAML' but it's already been converted to yaml. 这也令人困惑,因为在“编辑”菜单下,我可以选择“转换为YAML”,但它已经转换为yaml。 How do I get it to just take the json file and keep it as json? 如何获取仅获取json文件并将其保留为json的信息?

Swagger Editor is a YAML editor, it's designed to be used with YAML. Swagger Editor是一个YAML编辑器,旨在与YAML一起使用。 There's no way to disable automatic JSON->YAML conversion. 无法禁用自动JSON-> YAML转换。

That said, you can use the File > Convert and save as JSON command to export YAML back to JSON after you make the necessary changes. 也就是说,在进行必要的更改后,可以使用“ 文件”>“转换并另存为JSON”命令将YAML导出回JSON。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM