Giter Site home page Giter Site logo

testinggospels / camoswag Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 22 KB

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.

Home Page: http://fauxauldrich.github.io/camouflage/

License: MIT License

JavaScript 100.00%
testing rest api stub grpc mocking api-simulation service-virtualization camouflage

camoswag's Introduction

Camoswag

Camoswag is a Camouflage extension which allows you to generate your mockfiles using an OpenAPI Specification.

For more information on Camouflage, see documentation

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.
{
  "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)

camoswag's People

Contributors

shubhendumadhukar avatar

Watchers

 avatar

camoswag's Issues

OpenApi example support

It would be nice if the tool generates the mock files using x-example and x-examples OpenApi 2.0 feature.

RangeError: Maximum call stack size exceeded

Hello, during the execution of camoswag of the attached swagger file (I edited the extension from json to txt as GH does not allow json files), I occurred into the error as per title, depicted into attached screen. The folder generated by camoswag is empty

image
marqeta-swagger.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.