Schema error

953 views
Skip to first unread message

Olympacs

unread,
Sep 14, 2017, 3:20:54 PM9/14/17
to Swagger
I am working on an existing api. Once it loads it shows a set of errors. I googled online but found similar errors when creating api's from scratch when you require path parameters. Please advise.

Errors

Schema error 

should NOT have additional properties additionalProperty: dataset

Schema error 

should have required property 'info' missingProperty: info

Schema error 

should have required property 'paths' missingProperty: paths

Olympacs

unread,
Sep 14, 2017, 3:21:41 PM9/14/17
to Swagger
I am attaching the code
Screenshot (12).png

Ron Ratovsky

unread,
Sep 15, 2017, 6:03:33 AM9/15/17
to swagger-sw...@googlegroups.com

Hello,

 

The validation errors pretty much tell you what you’re doing wrong.

Please follow the documentation to learn about the structure of an API definition and take it from there.

https://swagger.io/docs/specification/2-0/basic-structure/

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Olympacs

unread,
Sep 15, 2017, 8:04:45 PM9/15/17
to Swagger

I have just edited the entire code referring to the docs. I am still getting the errors.

Errors

Schema error 

should NOT have additional properties additionalProperty: get, datasets/{opec}, -in, database_code, type, required, description, responses:10000, path, datasets/{opec}/{orb}

Schema error at paths

should be object

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Screenshot (13).png

Ron Ratovsky

unread,
Sep 18, 2017, 2:02:30 AM9/18/17
to swagger-sw...@googlegroups.com

YAML is sensitive to indentation.

From what you shared it seems like a lot is misplaced or poorly indented.

The error actually tells you which keywords cannot exist under the root, hinting you what’s not indented properly.

 

Another point – paths must begin with a ‘/’.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages