This tool generates an Open API 3.0 (swagger) spec from BrightHive tableschema descriptor files!
BrightHive Data Resources are set up using modified frictionless table schema descriptor files. What is table schema?.
This package will convert your set of descriptor files into a Open API 3.0 (swagger) spec. What is Swagger?
This allows developers to generate and create clients easily that can easily interact with BrightHive Data Resources.
-
Install the released version package from Github into your project with pip.
-
Import the function
convert_descriptor_to_swagger
. -
Pass a list of descriptor files to it.
-
Optionally pass an array of relationships. This will generate the many to many relationships.
-
The function will return a swagger spec that can be used to build clients for your Data Resources.
The convert_descriptor_to_swagger
function can optionally take a relationships
list. It expects a list of relationship lists. This should look like the following:
[["people", "team"], ["student", "classroom"]]
The items within the "relationship list" should match the names of tables found in the descriptor file.
This will add both /parent/{id}/child/
and /child/{id}/parent
routes to your swagger file.
We welcome code contributions, suggestions, and reports! Please report bugs and make suggestions using Github issues. The BrightHive team will triage and prioritize your issue as soon as possible.
-
Install pipenv
-
Install docker and docker-compose
-
Clone the repo
-
Install production and development packages
pipenv install --dev
-
Install pre-commit hooks
pipenv run pre-commit install
In the event that you want to run pre-commit hooks over the entire application use the following,
pipenv run pre-commit run --all-files
Use pipenv run pytest tests
to run the tests.
BrightHive welcomes and appreciates your contributions! Contribute by doing one (or more) of the following:
-
Report a bug Did you encounter a bug? Please open a descriptive issue on Github. We will respond as soon as we can.
-
Request a feature You can request a feature by opening an issue on Github, and if it seems viable, BrightHive will allocate development time to implement it.
-
Create a pull request Check out a branch, push your commits to Github, and open a pull request. (N.b., you can either fork or clone the repo.) Add a detailed description of your changes, and finally, request a review from someone on the BrightHive team (see below).
Read more about the open-source community here, and learn more about creating a pull request here.
Names and titles of core contributors (including people who did not push code to Github). Use bullets, for example:
* Logan Ripplinger (Software Engineer)