my json return error: Swagger UI

171 views
Skip to first unread message

Frans Thamura

unread,
Feb 24, 2015, 4:53:54 PM2/24/15
to swagger-sw...@googlegroups.com
Hi all

i try to import in swagger editor my run json of swagger doc

http://api.yama.meruvian.org/v1/api-docs/news

this is the swagger-editor url that i used

http://editor.swagger.io/#/

error code

✖ Swagger Error

Missing required property: paths

Details

Object
code: "OBJECT_MISSING_REQUIRED_PROPERTY"
message: "Missing required property: paths"
path: Array [0]
level: 900
$$hashKey: "object:572"

tony tam

unread,
Feb 25, 2015, 2:04:38 AM2/25/15
to swagger-sw...@googlegroups.com
Hi the swagger you point to at http://api.yama.meruvian.org/v1/api-docs/news is swagger 1.2.  The editor is 2.0.

You can convert it to 2.0 as such:

* clone swagger-codegen
* build with mvn package
* save your spec (http://api.yama.meruvian.org/v1/api-docs/news) to the file sample.json
* convert your spec:

java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.3-M1-SNAPSHOT.jar -i sample.json -l swagger -o .


Now you can read the file "swagger.json" in the editor.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages