diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-10-03 12:14:01 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-10-03 12:14:01 +0000 |
| commit | bb1a44b0c75471b5c004170552540b9632f89810 (patch) | |
| tree | a8450f9ba19595d22981c4ce514299dac5300915 /test/python/test_groups.py | |
| parent | c379119d85dc23f855dee005856576cac38126c8 (diff) | |
| download | genenetwork4-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
