OpenAPI doc rendering website built with Flask.
To run the project locally, install Docker.
If you are not making changes to the codebase, you can deploy the latest docker image via docker compose:
services:
openapi-render:
image: ghcr.io/mtmustski/openapi-render:v1.0.0
container_name: openapi-render
ports:
- "5000:5000"
volumes:
- /path/to/api-docs:/app/static/api-docs
To load OpenAPI files into the application, create a JSON file inside a directory such as api-docs
with the following content:
{
"source": "api.yaml",
"project_page": "www.example.com"
}
Note that the api.yaml
file in the above snippet must live inside the same directory the JSON file is created in.
Create a new JSON file for each OpenAPI file.
When developing, place the above JSON file inside /app/static/api-docs
.
Then run docker compose up
. This will start the flask app in development mode and should be available
at http://localhost:5000.
In the development build, code changes will automatically reload so there is no need to restart the docker container after making a change.
If you would like to run the production version of the project locally, build the docker image
with docker-compose build
. Then run docker compose -f docker-compose.yml up
.
Unlike the development build, changes to the source code will not auto reload. To see your new changes, you must bring the containers down, rebuild the container and launch it again.