mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
The bump job of release-all.yml stopped in openapi/generate_openapi.py with
"AttributeError: 'NoneType' object has no attribute 'name'". Notification
delivery builds part of the Boards, Integrations, Settings and Users schemas
with `...deliverySchemaFields('notificationDelivery')`, and the generator
read the key of every schema property, which a spread does not have.
A spread is now documented as one optional object named by the helper's
first string argument - notificationDelivery on all four - and a spread with
no such name is skipped with a warning. The generated spec renders with
@redocly/cli. tests/openapiSchemaSpread.test.cjs runs the whole generator
when a Python with esprima is available, and fails on any schema spread in
models/ that would be left undocumented.
Thanks to xet7 !
OpenAPI tools and doc generation
Open API generation
This folder contains a script (generate_openapi.py) that extracts
the REST API of Wekan and exports it under the OpenAPI 2.0 specification
(Swagger 2.0).
dependencies
- python3
- esprima-python
calling the tool
python3 generate_openapi.py --release v7.92 > ../public/api/wekan.yml
Generating docs
Now that we have the OpenAPI, it's easy enough to convert the YAML file into some nice Markdown with shins and api2html, or even ReDoc:
api2html -c ../public/logo-header.png -o api.html ../public/wekan_api.yml
or
redoc-cli serve ../public/wekan_api.yml