APIs-guru / openapi-directory

🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
https://apis.guru/
Creative Commons Zero v1.0 Universal
3.87k stars 578 forks source link

Add tests for APIs.guru own API #52

Closed IvanGoncharov closed 6 years ago

IvanGoncharov commented 8 years ago

Test according to https://github.com/APIs-guru/api-models/blob/master/API.md Basically, test content of this file https://apis-guru.github.io/api-models/api/v1/list.json Preferably implemented as JSON Schema validation, JSON Schema could be extracted from here: https://github.com/APIs-guru/api-models/blob/master/scripts/apis_guru_swagger.yaml

If you want to help write here and I will provide more details.

MikeRalphson commented 8 years ago

Do you have a test framework or continuous integration service (e.g. travis) in mind for this?

IvanGoncharov commented 8 years ago

@MikeRalphson EDIT: Sorry, confused bugs. Read title of issue 53 and your response in this one :) ~~It would be great to have something like that. Even to make single request per API already test a lot of stuff: host, basePath, securityDefinitions, etc. But significantly bigger effort than to fix Watson API. I gladly accept any help with both generic test system and Watson APIs.~~

IvanGoncharov commented 8 years ago

@MikeRalphson On every commit, I run Tavis and it creates deploy dir and push it to gh-pages branch. You can see an entire process by running npm install and scripts/deploy.sh from the root of my repo. So on the next step, it would be cool to run validation script. It could be anything, but I personally worked only with mocha+chai so it's preferred option. Also, for chai there is plugin to validate against JSON Schema: https://github.com/Bartvds/chai-json-schema

MikeRalphson commented 6 years ago

Looking to use dredd. Waiting on https://github.com/apiaryio/dredd/issues/553

May need to explicitly set the produces content-type to application/json; charset: utf8

MikeRalphson commented 6 years ago

Testing with dredd working now. externalDocs property added to API definition response model.