Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
/ spear Public archive

A service to render OpenAPI specifications stored on Github

Notifications You must be signed in to change notification settings

festicket/spear

Repository files navigation

SPEAR

A service to render OpenAPI specification files stored on GitHub. It also generates API endpoints which return dummy data based on the specification.

Quickstart

Change $GOPATH to the current directory using:

source activate

Install the dependencies required:

make install

We use dep for that.

To build the binary for Linux, run the command:

make build

After that you can just run the binary created:

./bin/spear

These are environment variables you need to set to make it work:

  • GITHUB_TOKEN - your github token. Generate it here.
  • SPECS_DIR - a string with information about the target repository in format owner;repo;path: owner - owner of the repository, repo - name of the repository, path - a path within the repository to the root folder with spec files.
  • USERNAME and PASSWORD to enable Basic Auth.

Docker

You can use Docker for local development as well.

First, you need to create the compose file, use the example provided:

 cp docker-compose.yml.example docker-compose.yml

Don't forget to update values for environment variables in docker-compose.yml.

You can automatically build the binary and image then run it via next command:

make bup

Visit http://localhost:8000

TODO

  • Build a docker image
  • Branch selector
  • Support definitions in separate files
  • Build responses from examples whenever it is possible
    • Get
    • Post
    • Not only 200 responses but provide a way to request an expected response code
  • Cache requests (to avoid rate limits from Github)
    • Ability to reset the cache manually
  • Clear the code

About

A service to render OpenAPI specifications stored on Github

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published