Skip to content

Commit 307c03a

Browse files
📝 Update documentation.
1 parent 6e2628e commit 307c03a

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

Readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@
33
[![.github/workflows/test.yml](https://github.com/python-lapidary/lapidary-render/actions/workflows/test.yml/badge.svg)](https://github.com/python-lapidary/lapidary-render/actions/workflows/test.yml)
44

55
Lapidary-render is a program that generates Python Web API clients from OpenAPI documents.
6+
7+
## Why
8+
9+
OpenAPI is a machine readable description of Web APIs. A large subset of it is very well suited for automatic translation to a client code.
10+
11+
## How
12+
13+
Lapidary render uses [Jinja](https://jinja.palletsprojects.com/) to generate client code, but most of the translation from OpenAPI to python is implemented in python itself. This makes it easier to read and maintain the generator itself.
14+
15+
Instead of generating large pieces of code that convert data and call http libraries, Lapidary generates code that uses [Lapidary runtime library](https://github.com/python-lapidary/lapidary). It's also a way to greatly simplify the code, at the expense of small runtime overhead related to processing method signatures.

docs/index.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,23 @@ Renders the client code in the project root. The default project root is the cur
4747

4848
All python files are generated in the `PROJECT_ROOT/gen` directory.
4949

50-
If the patches directory (`PROJECT_ROOT/src/patches` by default) exists, Lapidary will read all JSON and YAML files
51-
and apply them as JSONPatch files against the original OpenAPI file.
52-
5350
## Configuration
5451

5552
Lapidary can be configured with a `pyproject.yaml` file of the client project, under `[tool.lapidary]` key.
5653

57-
- package - root package name.
58-
- document_path - path of the OpenAPI document, relative to the project root.
59-
- origin - URL of the OpenAPI document, used when document_path is missing, or when `servers` is not defined, or the first server URL is a relative path.
60-
- patches - patches directory [default = 'src/patches'].
54+
package
55+
: root package name.
56+
57+
document_path
58+
: path of the OpenAPI document, relative to the project root.
59+
60+
origin
61+
: URL of the OpenAPI document, used when document_path is missing, or when `servers` is not defined, or the first server URL is a relative path.
62+
63+
extra_sources
64+
: list of additional source roots for manually written code. The files will be interpreted as templates, but non-template files will also work.
65+
66+
plugins
67+
: list of plugin classes. See [the section on plug-ins](/plugins)
6168

6269
At least one of `document_path` and `origin` is required. Saving OpenAPI document in the project is recommended for repeatable builds.

0 commit comments

Comments
 (0)