@@ -58,6 +58,7 @@ dev = [
5858 " ty~=0.0.0" ,
5959 " types-colorama<0.5.0" ,
6060 " werkzeug<4.0.0" , # Werkzeug is used by pytest-httpserver
61+ " datamodel-code-generator[http,ruff]<1.0.0" ,
6162]
6263
6364[tool .hatch .build .targets .wheel ]
@@ -138,6 +139,11 @@ indent-style = "space"
138139 " N999" , # Invalid module name
139140 " T201" , # print found
140141]
142+ "src/apify_client/_models.py" = [
143+ " D" , # Everything from the pydocstyle
144+ " E501" , # Line too long
145+ " ERA001" , # Commented-out code
146+ ]
141147
142148[tool .ruff .lint .flake8-quotes ]
143149docstring-quotes = " double"
@@ -178,3 +184,22 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "assert_never()"]
178184
179185[tool .ipdb ]
180186context = 7
187+
188+ # https://koxudaxi.github.io/datamodel-code-generator/
189+ [tool .datamodel-codegen ]
190+ # url = "https://docs.apify.com/api/openapi.json"
191+ input = " ../apify-docs/static/api/openapi.json"
192+ input_file_type = " openapi"
193+ output = " src/apify_client/_models.py"
194+ target_python_version = " 3.10"
195+ output_model_type = " pydantic_v2.BaseModel"
196+ use_schema_description = true
197+ use_field_description = true
198+ use_union_operator = true
199+ capitalise_enum_members = true
200+ collapse_root_models = true
201+ set_default_enum_member = true
202+ use_annotated = true
203+ wrap_string_literal = true
204+ snake_case_field = true
205+ formatters = [" ruff-check" , " ruff-format" ]
0 commit comments