Skip to content

Commit a6b59e4

Browse files
committed
Update class overrides example to remove irrelevant limitation
1 parent a4cd35e commit a6b59e4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ You can pass a YAML (or JSON) file to openapi-python-client in order to change s
6767
are supported:
6868

6969
### class_overrides
70-
Used to change the name of generated model classes, especially useful if you have a name like ABCModel which, when
71-
converted to snake case for module naming will be a_b_c_model. This param should be a mapping of existing class name
72-
(usually a key in the "schemas" section of your OpenAPI document) to class_name and module_name.
70+
Used to change the name of generated model classes. This param should be a mapping of existing class name
71+
(usually a key in the "schemas" section of your OpenAPI document) to class_name and module_name. As an example, if the
72+
name of the a model in OpenAPI (and therefore the generated class name) was something like "_PrivateInternalLongName"
73+
and you want the generated client's model to be called "ShortName" in a module called "short_name" you could do this:
7374

7475
Example:
7576
```yaml
7677
class_overrides:
77-
ABCModel:
78-
class_name: ABCModel
79-
module_name: abc_model
78+
_PrivateInternalLongName:
79+
class_name: ShortName
80+
module_name: short_name
8081
```
8182
8283
The easiest way to find what needs to be overridden is probably to generate your client and go look at everything in the

0 commit comments

Comments
 (0)