Commit Graph

5 Commits

Author SHA1 Message Date
orientor e989c87a18 openapi: Fix response validation bug.
Currently there are no checks in validate_against_openapi_schema
to check whether the `content` it received actually matched with
the `response code`. For example during testing if a certain endpoint
was returning 400 but it was expected to return 200, then it would
pass schema validation as it would only have `msg` and `result` keys.
Add this validation and fix the wrong response returning points.
2020-06-10 16:45:36 -07:00
Rohitt Vashishtha 1e4ad0bdfc js-api: Migrate and test send-message example. 2020-05-20 10:18:29 -07:00
Rohitt Vashishtha 203b722624 js-api: Migrate and test create-user example. 2020-05-20 10:18:29 -07:00
Kartik Srivastava 302906211d js-api: Refactor ExamplesHandler to avoid running examples in a loop.
This refactors `ExamplesHandler` to avoid running examples in a loop
and add result objects to `response_data` array one by one with
`generate_validation_data`.
2020-05-20 10:18:29 -07:00
Rohitt Vashishtha 31d04fb370 js-api: Add module to create and run JS API examples.
This file will act as the container for all JS API examples to use
in our documentation, similar to our python and curl API testing
and examples generation code.

This module has two modes of operation:

- node javascript_examples.js generate-responses

   This mode runs all the examples against a server and prints the JSON
   output of all the examples we ran.

- node javascript_examples.js generate-example <endpoint>

   This mode prints example code for endpoints like: /users:post. We then
   want to render this full example code in our docs.
2020-05-20 10:18:29 -07:00