简体   繁体   中英

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. I can go to localhost and view the editor there. 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. 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. How do I get it to just take the json file and keep it as json?

Swagger Editor is a YAML editor, it's designed to be used with YAML. There's no way to disable automatic JSON->YAML conversion.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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