Files
wekan/openapi
Lauri Ojansivu 9c79602b64 Let the OpenAPI generator survive declarations without an initializer.
The release-all bump job stopped in openapi/generate_openapi.py with
"AttributeError: 'NoneType' object has no attribute 'type'": a REST
handler declares `let x;`, and the req.body walker read the declarator's
absent init. The walker now returns early on an absent node, and walks
the branches of a `?:` so fields read there (the board copy title,
among others) are documented again. downlevel_js also rewrites `||=`
and `&&=`, which esprima cannot parse and which made the generator skip
models/lib/importedAttachmentsByCard.js.

tests/openapiReqBodyWalker.test.cjs pins the guard, the ternary walk and
the rewrite, drives the walker on the shapes that broke it, and runs the
whole generator asserting no file is skipped.

Thanks to xet7 !
2026-09-29 22:45:14 +03:00
..

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

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