A service to render OpenAPI specification files stored on GitHub. It also generates API endpoints which return dummy data based on the specification.
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 formatowner;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
andPASSWORD
to enable Basic Auth.
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
- 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