Generate RTK Query TypeScript from OpenAPI (cached JSON).
Project description
exdrf-gen-openapi2rtk
exdrf-gen-openapi2rtk is an exdrf-gen plugin that turns an OpenAPI
3.x JSON document into RTK Query TypeScript modules (endpoints, hooks, and
generated request/response wiring). It can load a local file or fetch a remote
spec with optional HTTP caching.
Python 3.12.2+ is required. Dependencies (attrs, click,
exdrf-gen, exdrf-ts) are listed in pyproject.toml.
Plugin registration
[project.entry-points.'exdrf.plugins']
exdrf_gen = 'exdrf_gen_openapi2rtk'
Install exdrf-gen and exdrf-gen-openapi2rtk in the same environment;
then exdrf-gen --help lists openapi2rtk.
Usage
CLI
The command is registered on the shared exdrf-gen CLI as
openapi2rtk:
python -m exdrf_gen openapi2rtk /path/to/routes/out \
--openapi-file /path/to/openapi.json \
--types-import "@app/models" \
--base-api-profile minimal
Use --base-api-profile fr_one when generating for the fr-one customer
SPA (same wiring as historical resi_gen r2ts output).
Remote specs: pass --openapi-url (and optional cache flags) instead of or
in addition to --openapi-file—see exdrf-gen --help / subcommand help
for the exact options in your installed version.
See also
resi_gen r2tsin bk-one snapshotsapp.openapi(), then calls this generator with--types-import @resi/modelsandfr_onebase API.exdrf-gen— shared CLI, Jinja environment, and plugin loading.exdrf-ts— type mapping helpers used during emission.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file exdrf_gen_openapi2rtk-0.1.17.tar.gz.
File metadata
- Download URL: exdrf_gen_openapi2rtk-0.1.17.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
806f7d45e97c71e3a009150b6dde976b4e4bda4c55efbcc9571c96b793ba80b1
|
|
| MD5 |
55ad189b0b51e4d367840e039c64ca61
|
|
| BLAKE2b-256 |
1e15430e0171409a14f981f382e19af1a077f858d5757fb962248b0491addbee
|
File details
Details for the file exdrf_gen_openapi2rtk-0.1.17-py3-none-any.whl.
File metadata
- Download URL: exdrf_gen_openapi2rtk-0.1.17-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
444c2c674c04683b9166f55352195adf1fd21ce3ca0ba25897122bc21acd3771
|
|
| MD5 |
78b5a45858a39c175617361d9fca2160
|
|
| BLAKE2b-256 |
443d3cb580897806988753df1cf721a0bdd71a2542acea8cdee469796a22459b
|