Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dan-da/bisq-api
API docs and unit tests for bisq/bitsquare.
https://github.com/dan-da/bisq-api
Last synced: about 1 month ago
JSON representation
API docs and unit tests for bisq/bitsquare.
- Host: GitHub
- URL: https://github.com/dan-da/bisq-api
- Owner: dan-da
- License: gpl-3.0
- Created: 2017-04-08T20:43:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-08T21:29:51.000Z (over 7 years ago)
- Last Synced: 2024-04-16T22:29:22.184Z (9 months ago)
- Language: PHP
- Size: 43.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bisq-api
========This repository contains files pertaining to bisq APIs.
In particular the areas of:
* specification
* documentation
* schema validation
* unit testing## Installation
### composer is required.
On Ubuntu 16.04:
sudo apt install composer
On Ubuntu 14.04curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Anything else, visit http://getcomposer.com.### now let's get to it!
$ git clone https://github.com/dan-da/bisq-api.git
$ cd bisq-api
$ composer install
## Building Docs```
$ ./build-api-docs.sh
API Docs are in apis/index.html and apis/README.md
```Also, docs are viewable online at:
https://rawgit.com/dan-da/bisq-api/master/apis/index.html## Running unit tests
The tests run against a running bisq (bitsquare) instance.
At the time of this writing, API support is only available in bisq on
development branch issue544-api. So it is necessary to checkout and
build that branch first. When you have done this, then you need to
start bitsquare and ensure that it is listening on port 8080.You can verify that bitsquare API support is working by loading this url in a
browser:
http://localhost:8080/apis/currency_listOnce that is working, proceed to run unit tests as follows:
```
$ ./run-api-tests.sh
_____ ___ ___ _____ ___ ___
|_ _/ __)( __/_ _/ __)| _ )
|_| \___ /___) |_| \___ |_|_\ v1.7.1PHP 7.0.15-0ubuntu0.16.04.4 | '/usr/bin/php' -c '/tmp/.php.ini' | 8 threads
...
OK (3 tests, 0.1 seconds)
```## Directory layout
/ project root. contains shell scripts to perform actions.
apis/ api root
lib/ some common files
each api has its own directory with apidoc, schema, and unit test files.
vendor/ built automatically by composer.
## Docs build system
Documentation for each api is contained in /apis/\/apidoc.php in a
structured data format without any display markup.The build-api-docs.sh script processes each API directory and generates documentation
in both HTML and markdown formats. In the future it could be extended to
generated PDF or anything else.## JSON Schema for API responses
API responses contain complex structured data that is difficult to validate
manually.As such, a json schema is created for each API response, located in
/apis/\/schema.json.Initially, these schemas are created automagically by providing a sample JSON
response to this tool:https://jsonschema.net/#/editor
Further manual editing of the schemas may be desirable as we go forward.The unit tests for each API perform an API call and then validate the response
against the schema. Any validation error will cause the test to fail and the
errors are reported.## API Versioning.
The API will be versioned according to the bitsquare release version.
There is no separate versioning.