about summary refs log tree commit diff
path: root/test/python/test_groups.py
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-10-03 12:14:01 +0000
committerPjotr <wrk@bosa.lan>2026-10-03 12:14:01 +0000
commitbb1a44b0c75471b5c004170552540b9632f89810 (patch)
treea8450f9ba19595d22981c4ce514299dac5300915 /test/python/test_groups.py
parentc379119d85dc23f855dee005856576cac38126c8 (diff)
downloadgenenetwork4-bb1a44b0c75471b5c004170552540b9632f89810.tar.gz
Add /openapi.json describing the REST API.
* Cargo.toml (dependencies): Add utoipa, feature axum_extras; add
utoipa-axum.
* src/lib.rs: Use utoipa_axum::router::OpenApiRouter and routes!
instead of axum::Router and route!, so paths register into an OpenApi
document as well as the router.
(ApiDoc): New struct, deriving utoipa::OpenApi with title, description
and license.
(app): Add /openapi.json, serving the OpenApi document split out of
OpenApiRouter via split_for_parts.
(hello_world, version, species): Add #[utoipa::path(...)] attributes
describing each endpoint's responses.
(VersionInfo): Derive utoipa::ToSchema in addition to Serialize.
* src/db.rs (Species): Likewise.
* tests/openapi.rs: New file.  Checks /openapi.json's info.title and
that it lists all three endpoints.
* test/python/test_openapi.py: New file.  Likewise.
* README.md: Document /openapi.json.
* rust-package.scm: Regenerate with guix import crate -f Cargo.lock
genenetwork4.  Adds crate-source definitions for utoipa, utoipa-gen,
utoipa-axum and pastey.
* guix.scm (genenetwork4-git)[native-inputs]: Add rust-utoipa-6.0.0,
rust-utoipa-gen-6.0.1, rust-utoipa-axum-0.3.0 and rust-pastey-0.2.3.
Diffstat (limited to 'test/python/test_groups.py')
0 files changed, 0 insertions, 0 deletions