Skip to content

Commit c6ea807

Browse files
committed
update readme
1 parent b216a46 commit c6ea807

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,22 @@ Options:
3939
-r, --generate-routers Generate modular api with multiple routers using RouterAPI (for bigger applications).
4040
--specify-tags Use along with --generate-routers to generate specific routers from given list of tags.
4141
-c, --custom-visitors PATH - A custom visitor that adds variables to the template.
42+
-d, --output-model-type Specify a Pydantic base model to use (see [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator); default is `pydantic.BaseModel`).
43+
-p, --python-version Specify a Python version to target (default is `3.8`).
4244
--install-completion Install completion for the current shell.
4345
--show-completion Show completion for the current shell, to copy it
4446
or customize the installation.
4547
--help Show this message and exit.
4648
```
4749

50+
### Pydantic 2 support
51+
52+
Specify the Pydantic 2 `BaseModel` version in the command line, for example:
53+
54+
```sh
55+
$ fastapi-codegen --input api.yaml --output app --output-model-type pydantic_v2.BaseModel
56+
```
57+
4858
## Example
4959
### OpenAPI
5060
```sh

0 commit comments

Comments
 (0)