Help debugging a Swagger API spec - only error is about access-control-origin settings.

218 views
Skip to first unread message

Steve Cassidy

unread,
Apr 18, 2016, 2:43:36 AM4/18/16
to Swagger
Hi, 
 I'm trying to develop an API spec for a project using Swagger but having problems writing something that conforms to the spec and debugging it when it doesn't work.

I've had a working version that's displayed ok, but just adding in a new stanza to the spec has left me with something that doesn't work and fails with the "Can't read from server. It may not have the appropriate access-control-origin settings." message.   

I've tried using the editor at editor.swagger.io and it displays my API with an error "Not a valid parameter definition" - I can't see any issue with the line it points to and in the displayed version below, it seems to display the offending lines ok. 

In general I don't really have a good handle on how to write an API spec by hand without hitting errors like this.  I don't have a toolset that gives useful error messages and adding small bits of JSON seems to result in everything falling over.  Ideas about useable workflow would be appreciated.

The spec in question is at:


and should display at 


the whole project is here: https://github.com/stevecassidy/alveo-api

Any help appreciated.

Steve


Steve Cassidy

unread,
Apr 18, 2016, 4:14:48 AM4/18/16
to Swagger
Ok, to reply to my own post, I had some success in finding the errors in my file (some stray commas but mainly a wrongly structured "schema" entry). 

I used the python swagger_spec_validator to check the spec, it gave me line numbers with errors that actually made sense and I was able to track down the problems. 

I'd still welcome pointers on a development toolchain that works for writing specs by hand. 

Cheers,

Steve
Reply all
Reply to author
Forward
0 new messages