Swagger-editor: paste JSON not working

Created on 1 Feb 2016  Â·  16Comments  Â·  Source: swagger-api/swagger-editor

I create a YAML file, save it as JSON, but when I try to paste the JSON, it gives me errors.

bug

Most helpful comment

Has this fix been pushed? I'm still getting this same error, pasting or uploading a file.

All 16 comments

Can you share what errors you're getting? We can't do much with that info.

trivial example (but you'll get an error)

  1. go to editor
  2. File / New
  3. File / Download JSON
  4. open downloaded file, copy contents
  5. File / Paste JSON, paste contents
  6. get error:

Error
Object
message: "options.definition is required"
code: "UNCAUGHT_SWAY_WORKER_ERROR"

or swagger.json.txt

strangely, import -or- dragging-and-dropping the same JSON file loads it fine.

I can not reproduce this issue. Maybe you are using an old version of Swagger Editor.

+1

I have the same problem.

Same error with sample files.

I'm using your website.
On Feb 1, 2016 9:56 PM, "Sahar Jafari" [email protected] wrote:

I can not reproduce this issue. Maybe you are using an old version of
Swagger Editor.

—
Reply to this email directly or view it on GitHub
https://github.com/swagger-api/swagger-editor/issues/805#issuecomment-178390262
.

@saharj - I was able to reproduce the problem with the online version.

My bad! There is an error.

I just made a PR to fix this.

I'm sill getting that error at http://editor.swagger.io/#/ when I export a minimal example yaml as JSON, then paste it.

Please try clearing your browser cache. I've seen that cause trouble with spurious errors.

Clearing browser cache doesn't help (in Chrome browser on Windows 8.1).
I also can't import a .json file -- after selecting the file the import button is still locked.

@SEWilco This issue has been fixed and will be published on next release very soon.

@saharj Thanks. I'm just puzzled how it was ever broken, as any project using JSON as their standard should have noticed.

Has this fix been pushed? I'm still getting this same error, pasting or uploading a file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

delim29 picture delim29  Â·  4Comments

weldpua2008 picture weldpua2008  Â·  6Comments

freak4pc picture freak4pc  Â·  3Comments

gerbsen picture gerbsen  Â·  3Comments

variable picture variable  Â·  4Comments