Mermade / oas-kit

Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint

Home Page:https://mermade.org.uk/openapi-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why does browser not output json?

martin0 opened this issue · comments

browser conversion output at https://mermade.org.uk/openapi-converter
outputs indented text, not json

Checklist

unsure here

  • Conversion: I have checked my source definition is valid OpenAPI 2.0
  • Conversion: On valid OpenAPI 2.0 input, the conversion looks wrong
  • Validation: I believe my source definition is valid OpenAPI 3.0.x but the validator complains
  • Validation: I believe my source definition is invalid OpenAPI 3.0.x but the validator does not complain
  • Linting issue
  • Resolver issue

Detailed Description

browser conversion output at https://mermade.org.uk/openapi-converter
outputs indented text, not json
I've tried it with both petstore and my actual swagger input file
https://interactivebrokers.github.io/cpwebapi/swagger.json

Other stuff

https://github.com/asyncee/swagger_codegen

You're probably seeing YAML. If you use the API you can specify application/json in the Accept header.

I ran from command line instead and it produced json.
this could be daunting if someone hasn't used node before

thanks for your reply Mike

The command line can detect whether you're outputting to a json or a yaml file.

I don't think there's anything daunting about it.

setting up node and packages etc

It's a node package, it needs node.js - there is a Docker file if you prefer.

my point is the web browser experience should generate json by default.
otherwise its necessary to burrow into some hole that is not the main goal of the user
i'm thinking that simple modification would make a huge issue to user experience :-)