https://github.com/testinggospels/camoswag
Camoswag is an extension to Camouflage backend mocking tool, which allows you to quickly convert an OpenAPI Specification into a set of mocks usable by Camouflage.
https://github.com/testinggospels/camoswag
api api-simulation camouflage grpc mocking rest service-virtualization stub testing
Last synced: about 1 year ago
JSON representation
Camoswag is an extension to Camouflage backend mocking tool, which allows you to quickly convert an OpenAPI Specification into a set of mocks usable by Camouflage.
- Host: GitHub
- URL: https://github.com/testinggospels/camoswag
- Owner: testinggospels
- License: mit
- Created: 2021-05-17T16:17:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-17T16:38:49.000Z (almost 5 years ago)
- Last Synced: 2025-01-29T17:44:34.252Z (about 1 year ago)
- Topics: api, api-simulation, camouflage, grpc, mocking, rest, service-virtualization, stub, testing
- Language: JavaScript
- Homepage: http://fauxauldrich.github.io/camouflage/
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Camoswag
Camoswag is a Camouflage extension which allows you to generate your mockfiles using an OpenAPI Specification.
For more information on Camouflage, see [documentation](https://fauxauldrich.github.io/camouflage/)
# Getting Started
- To use `camoswag`, you would need your OpenAPI specification file in either .json or .yaml format.
- You don't need to install `camoswag` in order to run, you can simply run it using `npx`
- Run the command: `npx camoswag --spec ./swagger.yaml` or `npx camoswag --spec ./swagger.json`. (Replace file location with your spec file location)
- This would create a new folder with the name `camouflage-${current_timestamp}` containing the required folder structure and mock files corresponding to each endpoint defined in your spec file.
- You can either delete or modify the dummy responses placed in the mockfiles as per your expectations. Once you are satisfied with the modifications, you can move the contents of the folder to your original ${MOCK_DIR} of your running Camouflage server.
- Note that if your spec file doesn't contain a response defined for a given endpoint, `camoswag` would put following default response in the mock file.
```json
{
"message": "More Configuration Needed"
}
```
Note: camoswag currenty supports JSON responses only.
- To install `camoswag` locally, run command `npm i -g camoswag`
- Run conversion command using `camoswag --spec ./swagger.yaml` or `camoswag --spec ./swagger.json`. (Replace file location with your spec file location)